zstan commented on code in PR #1296:
URL: https://github.com/apache/ignite-3/pull/1296#discussion_r1012526118


##########
modules/schema/src/main/java/org/apache/ignite/internal/schema/SchemaUtils.java:
##########
@@ -45,38 +45,53 @@ public static SchemaDescriptor prepareSchemaDescriptor(int 
schemaVer, TableView
      * Prepares column mapper.
      *
      * @param oldDesc Old schema descriptor.
-     * @param oldTblColumns Old columns configuration.
      * @param newDesc New schema descriptor.
-     * @param newTblColumns New columns configuration.
      * @return Column mapper.
      */
     public static ColumnMapper columnMapper(
             SchemaDescriptor oldDesc,
-            NamedListView<? extends ColumnView> oldTblColumns,
-            SchemaDescriptor newDesc,
-            NamedListView<? extends ColumnView> newTblColumns
+            SchemaDescriptor newDesc
     ) {
-        ColumnMapper mapper = null;
+        // Rename not supported from standard, thus only deletion.
+        if (newDesc.keyColumns().length() != oldDesc.keyColumns().length()) {
+            Optional<Column> droppedKeyCol = 
Arrays.stream(oldDesc.keyColumns().columns())
+                    .filter(c -> 
!newDesc.column(c.schemaIndex()).name().equals(c.name()))
+                    .findAny();
+

Review Comment:
   I suppose that it absolutely correct approach, plz check how this 
schemaIndex`es are creating : 
org.apache.ignite.internal.schema.Columns#sortedCopy thus if columns have 
different indexes it`s occasion to rise a red flag )



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to