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);
}