You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/12/01 21:08:20 UTC
[GitHub] [ignite-3] AMashenkov commented on a change in pull request #455: IGNITE-15784 Mapper support arbitrary serializable user pojo.
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.
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 here (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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org