public RelDataType inferReturnType(SqlOperatorBinding opBinding) { for (SqlReturnTypeInference rule : rules) { RelDataType ret = rule.inferReturnType(opBinding); if (ret != null) { return ret; } } return null; } }
public RelDataType inferReturnType(SqlOperatorBinding opBinding) { for (SqlReturnTypeInference rule : rules) { RelDataType ret = rule.inferReturnType(opBinding); if (ret != null) { return ret; } } return null; } }
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { RelDataType ret = rule.inferReturnType(opBinding); if (ret == null) { // inferReturnType may return null; transformType does not accept or // return null types return null; } for (SqlTypeTransform transform : transforms) { ret = transform.transformType(opBinding, ret); } return ret; } }
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { RelDataType ret = rule.inferReturnType(opBinding); if (ret == null) { // inferReturnType may return null; transformType does not accept or // return null types return null; } for (SqlTypeTransform transform : transforms) { ret = transform.transformType(opBinding, ret); } return ret; } }
/** * Infers the return type of an invocation of this operator; only called * after the number and types of operands have already been validated. * Subclasses must either override this method or supply an instance of * {@link SqlReturnTypeInference} to the constructor. * * @param opBinding description of invocation (not necessarily a * {@link SqlCall}) * @return inferred return type */ public RelDataType inferReturnType( SqlOperatorBinding opBinding) { if (returnTypeInference != null) { return returnTypeInference.inferReturnType(opBinding); } // Derived type should have overridden this method, since it didn't // supply a type inference rule. throw Util.needToImplement(this); }
/** * Infers the return type of an invocation of this operator; only called * after the number and types of operands have already been validated. * Subclasses must either override this method or supply an instance of * {@link SqlReturnTypeInference} to the constructor. * * @param opBinding description of invocation (not necessarily a * {@link SqlCall}) * @return inferred return type */ public RelDataType inferReturnType( SqlOperatorBinding opBinding) { if (returnTypeInference != null) { RelDataType returnType = returnTypeInference.inferReturnType(opBinding); if (returnType == null) { throw new IllegalArgumentException("Cannot infer return type for " + opBinding.getOperator() + "; operand types: " + opBinding.collectOperandTypes()); } return returnType; } // Derived type should have overridden this method, since it didn't // supply a type inference rule. throw Util.needToImplement(this); }
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { SqlCallBinding callBinding = (SqlCallBinding) opBinding; ExplicitOperatorBinding newOpBinding = new ExplicitOperatorBinding( opBinding, collectOperandTypes( callBinding.getValidator(), callBinding.getScope(), callBinding.getCall())); return ReturnTypes.BOOLEAN_NULLABLE.inferReturnType( newOpBinding); }
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { SqlCallBinding callBinding = (SqlCallBinding) opBinding; ExplicitOperatorBinding newOpBinding = new ExplicitOperatorBinding( opBinding, collectOperandTypes( callBinding.getValidator(), callBinding.getScope(), callBinding.getCall())); return ReturnTypes.BOOLEAN_NULLABLE.inferReturnType( newOpBinding); }
TypeInferenceUtils.getDrillSqlReturnTypeInference(SqlKind.SUM.name(), ImmutableList.of()) .inferReturnType(oldCall.createBinding(oldAggRel)); sumType = typeFactory.createTypeWithNullability(sumType, true); final AggregateCall sumArgSquaredAggCall =
TypeInferenceUtils.getDrillSqlReturnTypeInference(SqlKind.SUM.name(), ImmutableList.of()) .inferReturnType(oldCall.createBinding(oldAggRel)); sumType = typeFactory.createTypeWithNullability(