public static SqlOpTable makeSelectOrTable(SqlOpTable node) { String alias = aliasGenerator.next(); SqlOpTable result = new SqlOpTable(node.getSchema(), node.getTableName(), alias); return result; }
public static SqlOpSelectBlock makeSelect(SqlOpTable node) { SqlOpTable opTable = makeSelectOrTable(node); SqlOpSelectBlock result = SqlOpSelectBlock.create(opTable); for (String columnName : opTable.getSchema().getColumnNames()) { result .getProjection() .put(columnName, new ExprVar(opTable.getAliasName() + "." + columnName)); } return result; }