public MutationPlan compileMutation(String sql) throws SQLException { if (logger.isDebugEnabled()) { logger.debug(LogUtil.addCustomAnnotations("Execute update: " + sql, connection)); } CompilableStatement stmt = parseStatement(sql); return compileMutation(stmt, sql); }
DelegateMutationPlan delegate = new DelegateMutationPlan(statement.compileMutation(updateStmtStr.toString())) { @Override public MutationState execute() throws SQLException {
@Test public void testHintInSubquery() throws Exception { try (Connection conn = DriverManager.getConnection(getUrl())) { setupTables(conn); PhoenixStatement stmt = conn.createStatement().unwrap(PhoenixStatement.class); String query = "UPSERT /*+ NO_INDEX */ INTO T(k, v1) SELECT /*+ NO_INDEX */ k,v1 FROM T WHERE v1 = '4'"; MutationPlan plan = stmt.compileMutation(query); assertEquals("T", plan.getQueryPlan().getTableRef().getTable().getTableName().getString()); query = "UPSERT INTO T(k, v1) SELECT /*+ NO_INDEX */ k,v1 FROM T WHERE v1 = '4'"; plan = stmt.compileMutation(query); // TODO the following should actually use data table T if we supported hints in subqueries assertEquals("IDX", plan.getQueryPlan().getTableRef().getTable().getTableName().getString()); } }
public MutationPlan compileMutation(String sql) throws SQLException { if (logger.isDebugEnabled()) { logger.debug(LogUtil.addCustomAnnotations("Execute update: " + sql, connection)); } CompilableStatement stmt = parseStatement(sql); return compileMutation(stmt, sql); }
public MutationPlan compileMutation(String sql) throws SQLException { if (logger.isDebugEnabled()) { logger.debug(LogUtil.addCustomAnnotations("Execute update: " + sql, connection)); } CompilableStatement stmt = parseStatement(sql); return compileMutation(stmt, sql); }
DelegateMutationPlan delegate = new DelegateMutationPlan(statement.compileMutation(updateStmtStr.toString())) { @Override public MutationState execute() throws SQLException {
DelegateMutationPlan delegate = new DelegateMutationPlan(statement.compileMutation(updateStmtStr.toString())) { @Override public MutationState execute() throws SQLException {