public RelDataType deriveType( SqlValidatorScope scope, SqlNode expr) { Objects.requireNonNull(scope); Objects.requireNonNull(expr); // if we already know the type, no need to re-derive RelDataType type = nodeToTypeMap.get(expr); if (type != null) { return type; } final SqlValidatorNamespace ns = getNamespace(expr); if (ns != null) { return ns.getType(); } type = deriveTypeImpl(scope, expr); Preconditions.checkArgument( type != null, "SqlValidator.deriveTypeInternal returned null"); setValidatedNodeType(expr, type); return type; }
expanded, new SqlIdentifier(alias, SqlParserPos.ZERO)); deriveTypeImpl(selectScope, expanded);
public RelDataType deriveType( SqlValidatorScope scope, SqlNode expr) { Objects.requireNonNull(scope); Objects.requireNonNull(expr); // if we already know the type, no need to re-derive RelDataType type = nodeToTypeMap.get(expr); if (type != null) { return type; } final SqlValidatorNamespace ns = getNamespace(expr); if (ns != null) { return ns.getType(); } type = deriveTypeImpl(scope, expr); Preconditions.checkArgument( type != null, "SqlValidator.deriveTypeInternal returned null"); setValidatedNodeType(expr, type); return type; }
public RelDataType deriveType( SqlValidatorScope scope, SqlNode expr) { Objects.requireNonNull(scope); Objects.requireNonNull(expr); // if we already know the type, no need to re-derive RelDataType type = nodeToTypeMap.get(expr); if (type != null) { return type; } final SqlValidatorNamespace ns = getNamespace(expr); if (ns != null) { return ns.getType(); } type = deriveTypeImpl(scope, expr); Preconditions.checkArgument( type != null, "SqlValidator.deriveTypeInternal returned null"); setValidatedNodeType(expr, type); return type; }
expanded, new SqlIdentifier(alias, SqlParserPos.ZERO)); deriveTypeImpl(selectScope, expanded);
expanded, new SqlIdentifier(alias, SqlParserPos.ZERO)); deriveTypeImpl(selectScope, expanded);
public RelDataType validateImpl(RelDataType targetRowType) { validator.inferUnknownTypes(validator.unknownType, scope, call); final RelDataType type = validator.deriveTypeImpl(scope, call); final SqlOperator operator = call.getOperator(); final SqlCallBinding callBinding = new SqlCallBinding(validator, scope, call); if (operator instanceof SqlUserDefinedTableFunction) { assert type.getSqlTypeName() == SqlTypeName.CURSOR : "User-defined table function should have CURSOR type, not " + type; final SqlUserDefinedTableFunction udf = (SqlUserDefinedTableFunction) operator; return udf.getRowType(validator.typeFactory, callBinding.operands()); } else if (operator instanceof SqlUserDefinedTableMacro) { assert type.getSqlTypeName() == SqlTypeName.CURSOR : "User-defined table macro should have CURSOR type, not " + type; final SqlUserDefinedTableMacro udf = (SqlUserDefinedTableMacro) operator; return udf.getTable(validator.typeFactory, callBinding.operands()) .getRowType(validator.typeFactory); } return type; }
public RelDataType validateImpl(RelDataType targetRowType) { validator.inferUnknownTypes(validator.unknownType, scope, call); final RelDataType type = validator.deriveTypeImpl(scope, call); final SqlOperator operator = call.getOperator(); final SqlCallBinding callBinding = new SqlCallBinding(validator, scope, call); if (operator instanceof SqlUserDefinedTableFunction) { assert type.getSqlTypeName() == SqlTypeName.CURSOR : "User-defined table function should have CURSOR type, not " + type; final SqlUserDefinedTableFunction udf = (SqlUserDefinedTableFunction) operator; return udf.getRowType(validator.typeFactory, callBinding.operands()); } else if (operator instanceof SqlUserDefinedTableMacro) { assert type.getSqlTypeName() == SqlTypeName.CURSOR : "User-defined table macro should have CURSOR type, not " + type; final SqlUserDefinedTableMacro udf = (SqlUserDefinedTableMacro) operator; return udf.getTable(validator.typeFactory, callBinding.operands()) .getRowType(validator.typeFactory); } return type; }