AMashenkov commented on a change in pull request #455:
URL: https://github.com/apache/ignite-3/pull/455#discussion_r760571449
##########
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:
For now, we allow only one-to-one mapping. (otherwise 'object <-> row'
translation looks ambiguous)
So, seems, we will need both methods to resolve: column->field and
field->column.
As columns must be written to a row in order, we need dummy-mapping for
missed columns (to write 'null' or 'column default'). Resolving 'column->field'
allow us to write columns in right order and write a row in one iteration.
On the client side, we may not know all the columns and their defaults. Do
we know and I'm wrong?
Resolving 'field->column' allow here to write all fields to a tuple (or
whatever client protocol sends to a server in MsgPack format).
However, I've no idea how to deal with orphan fields, when no column exists
that matches field name.
* should we pass them to a server and then bypass validation and ignore
orphans.
* disallow orphans and fails with SchemaMismatch exception.
--
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]