List<RexNode> columnExprs) { final RelOptTable targetTable = getTargetTable(call); final RelDataType targetRowType = targetTable.getRowType(); SqlNodeList targetColumnList = call.getTargetColumnList(); if (targetColumnList == null) {
public void materialize(RelNode queryRel, RelOptTable starRelOptTable) { this.queryRel = queryRel; this.starRelOptTable = starRelOptTable; assert starRelOptTable.unwrap(StarTable.class) != null; } }
/** * Constructs a qualified name for an optimizer table reference. * * @param table table of interest * @return qualified name */ public List<String> getQualifiedName(RelOptTable table) { return table.getQualifiedName(); }
@Override public RelNode visit(TableAccessRelBase scan) { RelOptTable relOptTable = scan.getTable(); final Table table = relOptTable.unwrap(Table.class); if (table.equals(starTable.tables.get(0))) { Mappings.TargetMapping mapping = Mappings.createShiftMapping( starRelOptTable.getRowType().getFieldCount(), 0, 0, relOptTable.getRowType().getFieldCount()); return CalcRel.createProject( new TableAccessRel(scan.getCluster(), starRelOptTable), Mappings.asList(mapping.inverse())); } return scan; }
public static void checkColumnOrigin( RelColumnOrigin rco, String expectedTableName, String expectedColumnName, boolean expectedDerived) { RelOptTable actualTable = rco.getOriginTable(); List<String> actualTableName = actualTable.getQualifiedName(); assertEquals( Iterables.getLast(actualTableName), expectedTableName); assertEquals( actualTable.getRowType() .getFieldList() .get(rco.getOriginColumnOrdinal()) .getName(), expectedColumnName); assertEquals( rco.isDerived(), expectedDerived); }
public JdbcTableModificationRel( RelOptCluster cluster, RelTraitSet traits, RelOptTable table, Prepare.CatalogReader catalogReader, RelNode child, Operation operation, List<String> updateColumnList, boolean flattened) { super( cluster, traits, table, catalogReader, child, operation, updateColumnList, flattened); assert child.getConvention() instanceof JdbcConvention; assert getConvention() instanceof JdbcConvention; final ModifiableTable modifiableTable = table.unwrap(ModifiableTable.class); if (modifiableTable == null) { throw new AssertionError(); // TODO: user error in validator } this.expression = table.getExpression(Queryable.class); if (expression == null) { throw new AssertionError(); // TODO: user error in validator } }
protected TableAccessRelBase( RelOptCluster cluster, RelTraitSet traits, RelOptTable table) { super(cluster, traits); this.table = table; if (table.getRelOptSchema() != null) { cluster.getPlanner().registerSchema(table.getRelOptSchema()); } }
public double getRows() { return table.getRowCount(); }
public RelNode toRel(RelOptTable table) { return table.toRel(createToRelContext()); }
Expressions.parameter(Collection.class, builder.newName("collection")); final Expression expression = table.getExpression(ModifiableTable.class); assert expression != null; // TODO: user error in validator assert ModifiableTable.class.isAssignableFrom( PhysTypeImpl.of( typeFactory, table.getRowType(), JavaRowFormat.CUSTOM); List<Expression> expressionList = new ArrayList<Expression>();
@Override public boolean isKey(BitSet columns) { return table.isKey(columns); }
public List<RelCollation> getCollationList() { return table.getCollationList(); }
public Expression getExpression(Class clazz) { return parent.getExpression(clazz); }
final Table leftTable = leftRelOptTable.unwrap(Table.class); final RelOptTable rightRelOptTable = right.getTable(); final Table rightTable = rightRelOptTable.unwrap(Table.class); if (leftTable instanceof StarTable && ((StarTable) leftTable).tables.contains(rightTable)) { Mappings.offset(rightMapping, ((StarTable) leftTable).columnOffset(rightTable), leftRelOptTable.getRowType().getFieldCount())); throw new Util.FoundOne( CalcRel.createProject(
public static void checkColumnOrigin( RelColumnOrigin rco, String expectedTableName, String expectedColumnName, boolean expectedDerived) { RelOptTable actualTable = rco.getOriginTable(); List<String> actualTableName = actualTable.getQualifiedName(); assertEquals( Iterables.getLast(actualTableName), expectedTableName); assertEquals( actualTable.getRowType().getFieldList() .get(rco.getOriginColumnOrdinal()).getName(), expectedColumnName); assertEquals( rco.isDerived(), expectedDerived); }
protected TableAccessRelBase( RelOptCluster cluster, RelTraitSet traits, RelOptTable table) { super(cluster, traits); this.table = table; if (table.getRelOptSchema() != null) { cluster.getPlanner().registerSchema(table.getRelOptSchema()); } }
public double getRows() { return table.getRowCount(); }
public RelNode toRel(RelOptTable table) { return table.toRel(createToRelContext()); }
@Override public boolean isKey(BitSet columns) { return table.isKey(columns); }
public List<RelCollation> getCollationList() { return table.getCollationList(); }