sanpwc commented on a change in pull request #330:
URL: https://github.com/apache/ignite-3/pull/330#discussion_r707504488



##########
File path: 
modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapper.java
##########
@@ -24,6 +24,7 @@
 /**
  * Column mapper interface.
  */
+// TODO: IGNITE-15480 Probably should be removed after index column mapping 
refactoring.

Review comment:
       I believe that within column to column in index context we don't need 
columnIndex (if you mean that column index here is position in columns list).
   
   From the user's perspective he creates index using column names: 
   ```
           SchemaTable scmTbl1 = SchemaBuilders.tableBuilder("PUBLIC", 
"tbl1").columns(
               SchemaBuilders.column("key", 
ColumnType.UUID).asNonNull().build(),
               SchemaBuilders.column("affKey", 
ColumnType.INT64).asNonNull().build(),
               SchemaBuilders.column("valStr", 
ColumnType.string()).asNullable().build(),
               SchemaBuilders.column("valInt", 
ColumnType.INT32).asNullable().build(),
               SchemaBuilders.column("valNull", 
ColumnType.INT16).asNullable().build()
           ).withIndex(
               SchemaBuilders.pkIndex()
                   .addIndexColumn("key").done()
                   .addIndexColumn("affKey").done()
                   .withAffinityColumns("affKey")
                   .build()
           ).build();
   ```
   However during configuration change we generate id for every column and 
substitute name with such id within "index schema":
   table
   ..name:PUBLIC.tbl1
   ..id: 41f7a3ca
   ..columns
   ....listItem0
   ......namedListKey: 0 (or "key" or 870024f6) it doesn't matter here 
   ......namedListVal:
   ........name: key
   ........**id: 870024f6**
   ........type: UUID
   ........nullable: false
      ...
   ..indexes
        ....
   ......name: PK_INDEX
   ......**columnIds: [870024f6]** instead of colNames
   
   Does it make sense?




-- 
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