public QueryPlan compileSelect(SelectStatement select) throws SQLException{ List<Object> binds = statement.getParameters(); StatementContext context = new StatementContext(statement, resolver, scan, sequenceManager); if (select.isJoin()) { JoinTable joinTable = JoinCompiler.compile(statement, select, context.getResolver()); return compileJoinQuery(context, binds, joinTable, false, false, null); } else { return compileSingleQuery(context, select, binds, false, true); } }
JoinCompiler.JoinTable join = JoinCompiler.compile(statement, select, resolver); Map<TableRef, TableRef> replacement = null; for (JoinCompiler.Table table : join.getTables()) {
private static JoinTable getJoinTable(String query, PhoenixConnection connection) throws SQLException { SQLParser parser = new SQLParser(query); SelectStatement select = SubselectRewriter.flatten(parser.parseQuery(), connection); ColumnResolver resolver = FromCompiler.getResolverForQuery(select, connection); select = StatementNormalizer.normalize(select, resolver); SelectStatement transformedSelect = SubqueryRewriter.transform(select, resolver, connection); if (transformedSelect != select) { resolver = FromCompiler.getResolverForQuery(transformedSelect, connection); select = StatementNormalizer.normalize(transformedSelect, resolver); } PhoenixStatement stmt = connection.createStatement().unwrap(PhoenixStatement.class); return JoinCompiler.compile(stmt, select, resolver); } }
public QueryPlan compileSelect(SelectStatement select) throws SQLException{ List<Object> binds = statement.getParameters(); StatementContext context = new StatementContext(statement, resolver, scan, sequenceManager); if (select.isJoin()) { JoinTable joinTable = JoinCompiler.compile(statement, select, context.getResolver()); return compileJoinQuery(context, binds, joinTable, false, false, null); } else { return compileSingleQuery(context, select, binds, false, true); } }
public QueryPlan compileSelect(SelectStatement select) throws SQLException{ List<Object> binds = statement.getParameters(); StatementContext context = new StatementContext(statement, resolver, scan, sequenceManager); if (select.isJoin()) { JoinTable joinTable = JoinCompiler.compile(statement, select, context.getResolver()); return compileJoinQuery(context, binds, joinTable, false, false, null); } else { return compileSingleQuery(context, select, binds, false, true); } }
JoinCompiler.JoinTable join = JoinCompiler.compile(statement, select, resolver); Map<TableRef, TableRef> replacement = null; for (JoinCompiler.Table table : join.getTables()) {
JoinCompiler.JoinTable join = JoinCompiler.compile(statement, select, resolver); Map<TableRef, TableRef> replacement = null; for (JoinCompiler.Table table : join.getTables()) {