final RelDataType rowType = table.getRowType(typeFactory); RelOptTable relOptTable = RelOptTableImpl.create(null, rowType, table); RelNode converted = toRel(relOptTable); bb.setRoot(converted, true); return;
final RelNode tableRel; if (shouldConvertTableAccess) { tableRel = toRel(table); } else { tableRel = new TableAccessRel(cluster, table);
/** Populates a materialization record, converting a table path * (essentially a list of strings, like ["hr", "sales"]) into a table object * that can be used in the planning process. */ void populate(Materialization materialization) { SqlParser parser = SqlParser.create(materialization.sql); SqlNode node; try { node = parser.parseStmt(); } catch (SqlParseException e) { throw new RuntimeException("parse failed", e); } SqlToRelConverter sqlToRelConverter2 = getSqlToRelConverter(getSqlValidator(), catalogReader); materialization.queryRel = sqlToRelConverter2.convertQuery(node, true, true); // Identify and substitute a StarTable in queryRel. // // It is possible that no StarTables match. That is OK, but the // materialization patterns that are recognized will not be as rich. // // It is possible that more than one StarTable matches. TBD: should we // take the best (whatever that means), or all of them? useStar(schema, materialization); RelOptTable table = this.catalogReader.getTable(materialization.materializedTable.path()); materialization.tableRel = sqlToRelConverter2.toRel(table); }
RelOptTable relOptTable = RelOptTableImpl.create(null, rowType, (TranslatableTable) table); RelNode converted = toRel(relOptTable); bb.setRoot(converted, true); return;
final RelNode tableRel; if (shouldConvertTableAccess) { tableRel = toRel(table); } else { tableRel = new TableAccessRel(cluster, table);