ptupitsyn commented on a change in pull request #455:
URL: https://github.com/apache/ignite-3/pull/455#discussion_r760940470



##########
File path: 
modules/api/src/main/java/org/apache/ignite/table/mapper/DefaultColumnMapper.java
##########
@@ -21,7 +21,7 @@
 import org.jetbrains.annotations.NotNull;
 
 /**
- * Simple mapper implementation that map a column to a class field.
+ * Mapper implementation which maps object fields to the columns by their 
names.

Review comment:
       I think we should have two-way mapping, column -> field and field -> 
column.
   
   We know the schema on the client side (column names and their order). We 
don't know defaults for now, but I don't think they are required.
   
   It should be easy to write the row in correct order from an object if we 
have `column -> field` mapping:
   
   ```
   for (var col : schema.columns()) {
       var fieldName = mapper.fieldForColumn(col.name());
       if (fieldName == null)
           packNil();
       else
           packValue(...);
   }
   ```




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