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; }
(SqlUserDefinedTableMacro) operator; final TranslatableTable table = udf.getTable(typeFactory, callBinding.operands()); final RelDataType rowType = table.getRowType(typeFactory); RelOptTable relOptTable = RelOptTableImpl.create(null, rowType, table,
(SqlUserDefinedTableMacro) operator; final TranslatableTable table = udf.getTable(typeFactory, callBinding.operands()); final RelDataType rowType = table.getRowType(typeFactory); RelOptTable relOptTable = RelOptTableImpl.create(null, rowType, table,
(SqlUserDefinedTableMacro) operator; final TranslatableTable table = udf.getTable(typeFactory, callBinding.operands()); final RelDataType rowType = table.getRowType(typeFactory); RelOptTable relOptTable = RelOptTableImpl.create(null, rowType, table,
(SqlUserDefinedTableMacro) operator; final TranslatableTable table = udf.getTable(typeFactory, callBinding.operands()); final RelDataType rowType = table.getRowType(typeFactory); RelOptTable relOptTable = RelOptTableImpl.create(null, rowType, table,