AMashenkov commented on code in PR #4807: URL: https://github.com/apache/ignite-3/pull/4807#discussion_r1873329993
########## modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/ModifyNode.java: ########## @@ -465,9 +479,25 @@ private boolean hasUpsertSemantic(int rowSize) { assert !columnDescriptor.virtual() : "Virtual column can't be updated"; - mapping[columnDescriptor.logicalIndex()] = columnCount + i; + mapping[columnDescriptor.logicalIndex()] = columnCount + i + mergeOffset; } return mapping; } + + private RowSchema getMappedRowSchema(RowFactory<RowT> inputRowFactory, int[] mapping) { + RowSchema schema; + if (mapping != null) { + List<TypeSpec> fields = inputRowFactory.rowSchema().fields(); + Builder builder = RowSchema.builder(); + for (int i : mapping) { + TypeSpec typeSpec = fields.get(i); + builder.addField(typeSpec); + } + schema = builder.build(); + } else { + schema = inputRowFactory.rowSchema(); + } + return schema; + } Review Comment: I meant this ``` class RowSchema { static RowSchema map(RowSchema schema, int[] mapping) { List<TypeSpec> fields = schema.fields(); Builder builder = builder(); for (int i : mapping) { TypeSpec typeSpec = fields.get(i); builder.addField(typeSpec); } return builder.build(); } } ``` -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org