xtern commented on code in PR #4807: URL: https://github.com/apache/ignite-3/pull/4807#discussion_r1863052254
########## modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/SqlRowHandler.java: ########## @@ -107,12 +107,16 @@ public RowWrapper concat(RowWrapper left, RowWrapper right) { @Override public RowWrapper map(RowWrapper row, int[] mapping) { Object[] fields = new Object[mapping.length]; + Builder schemaBuilder = RowSchema.builder(); + List<TypeSpec> originalFields = row.rowSchema().fields(); for (int i = 0; i < mapping.length; i++) { - fields[i] = row.get(mapping[i]); + int mappedIdx = mapping[i]; + fields[i] = row.get(mappedIdx); + schemaBuilder.addField(originalFields.get(mappedIdx)); } - return new ObjectsArrayRowWrapper(row.rowSchema(), fields); + return new ObjectsArrayRowWrapper(schemaBuilder.build(), fields); Review Comment: It's better to build schema single time for all rows. My suggestion (may be @lowka or you have better ideas) Add SqlRowHandler.schema(row) method Add additional parameter to map method and pass target schema. In splitMerge, for example, get schema of the first row and build target schema. And do the same in flushTuples for the UPDATE operation :thinking: p.s. may be it's also worth to mute this failure https://ci.ignite.apache.org/viewLog.html?buildId=8657663&buildTypeId=ApacheIgnite3xGradle_Test_RunAllTests&fromSakuraUI=true in this PR -- 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