Github user twdsilva commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/405#discussion_r238808710
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixStatement.java ---
    @@ -399,8 +401,21 @@ public Integer call() throws SQLException {
                                     }
                                     MutationState state = 
connection.getMutationState();
                                     MutationPlan plan = 
stmt.compilePlan(PhoenixStatement.this, Sequence.ValueOp.VALIDATE_SEQUENCE);
    -                                if (plan.getTargetRef() != null && 
plan.getTargetRef().getTable() != null && 
plan.getTargetRef().getTable().isTransactional()) {
    -                                    
state.startTransaction(plan.getTargetRef().getTable().getTransactionProvider());
    +                                PTable table = 
plan.getTargetRef().getTable();
    +                                if(table != null && connection.getSCN() != 
null && !connection.isRunningUpgrade() && !connection.isBuildingIndex()) {
    --- End diff --
    
    can you move these checks to UpsertCompiler? Also I think you can remove 
the second check for mutable tables with indexes here.


---

Reply via email to