stoty commented on code in PR #2222: URL: https://github.com/apache/phoenix/pull/2222#discussion_r2206537762
########## phoenix-core-client/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java: ########## @@ -1286,75 +1302,83 @@ public MutationState execute() throws SQLException { ImmutableBytesWritable ptr = context.getTempPtr(); final SequenceManager sequenceManager = context.getSequenceManager(); // Next evaluate all the expressions - int nodeIndex = nodeIndexOffset; PTable table = tableRef.getTable(); Tuple tuple = sequenceManager.getSequenceCount() == 0 ? null : sequenceManager.newSequenceTuple(null); - for (Expression constantExpression : constantExpressions) { - if (!constantExpression.isStateless()) { - nodeIndex++; - continue; - } - PColumn column = allColumns.get(columnIndexes[nodeIndex]); - constantExpression.evaluate(tuple, ptr); - Object value = null; - if (constantExpression.getDataType() != null) { - value = constantExpression.getDataType().toObject(ptr, constantExpression.getSortOrder(), - constantExpression.getMaxLength(), constantExpression.getScale()); - if (!constantExpression.getDataType().isCoercibleTo(column.getDataType(), value)) { - throw TypeMismatchException.newException( - constantExpression.getDataType(), column.getDataType(), "expression: " - + constantExpression.toString() + " in column " + column); + + int index = -1; + for (byte[][] valuesListIem : valuesList) { Review Comment: Keeping the two lists in sync like this awkward. Using an old-style for() would be more readable to me: for(int index=0; index<valuesList.length();i++) and then use the index to get both the valuesListItem and constantExpression. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org