private boolean isBoolean(RexNode node) { RelDataType type = node.getType(); return SqlTypeUtil.inBooleanFamily(type); }
private boolean isBoolean(RexNode node) { RelDataType type = node.getType(); return SqlTypeUtil.inBooleanFamily(type); }
protected void validateWhereOrOn( SqlValidatorScope scope, SqlNode condition, String keyword) { validateNoAggs(condition, keyword); inferUnknownTypes( booleanType, scope, condition); condition.validate(this, scope); final RelDataType type = deriveType(scope, condition); if (!SqlTypeUtil.inBooleanFamily(type)) { throw newValidationError(condition, RESOURCE.condMustBeBoolean(keyword)); } }
if (!SqlTypeUtil.inBooleanFamily(condition.getType())) { assert !fail : "condition must be boolean"; return false;
if (!SqlTypeUtil.inBooleanFamily(condition.getType())) { assert !fail : "condition must be boolean"; return false;
protected void validateWhereOrOn( SqlValidatorScope scope, SqlNode condition, String keyword) { validateNoAggs(condition, keyword); inferUnknownTypes( booleanType, scope, condition); condition.validate(this, scope); final RelDataType type = deriveType(scope, condition); if (!SqlTypeUtil.inBooleanFamily(type)) { throw newValidationError( condition, EigenbaseResource.instance().CondMustBeBoolean.ex(keyword)); } }
protected void validateHavingClause(SqlSelect select) { // HAVING is validated in the scope after groups have been created. // For example, in "SELECT empno FROM emp WHERE empno = 10 GROUP BY // deptno HAVING empno = 10", the reference to 'empno' in the HAVING // clause is illegal. final SqlNode having = select.getHaving(); if (having == null) { return; } final AggregatingScope havingScope = (AggregatingScope) getSelectScope(select); havingScope.checkAggregateExpr(having, true); inferUnknownTypes( booleanType, havingScope, having); having.validate(this, havingScope); final RelDataType type = deriveType(havingScope, having); if (!SqlTypeUtil.inBooleanFamily(type)) { throw newValidationError(having, RESOURCE.havingMustBeBoolean()); } }
protected void validateHavingClause(SqlSelect select) { // HAVING is validated in the scope after groups have been created. // For example, in "SELECT empno FROM emp WHERE empno = 10 GROUP BY // deptno HAVING empno = 10", the reference to 'empno' in the HAVING // clause is illegal. final SqlNode having = select.getHaving(); if (having == null) { return; } final AggregatingScope havingScope = (AggregatingScope) getSelectScope(select); havingScope.checkAggregateExpr(having, true); inferUnknownTypes( booleanType, havingScope, having); having.validate(this, havingScope); final RelDataType type = deriveType(havingScope, having); if (!SqlTypeUtil.inBooleanFamily(type)) { throw newValidationError( having, EigenbaseResource.instance().HavingMustBeBoolean.ex()); } }
callBinding.getScope(), node); if (!SqlTypeUtil.inBooleanFamily(type)) { if (throwOnFailure) { throw callBinding.newError(RESOURCE.expectedBoolean());
callBinding.getScope(), node); if (!SqlTypeUtil.inBooleanFamily(type)) { if (throwOnFailure) { throw callBinding.newError(