Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
None
-
None
Description
Take a look at the scenario below:
static class Key { int int_col; String str_col; } static class Val { boolean bool_col; LocalDate date_col; } sql("CREATE TABLE test (int_col INT, bool_col BOOLEAN, date_col DATE, str_col VARCHAR, PRIMARY KEY (int_col, str_col))"); KeyValueView<Key, Val> kvView = CLUSTER.aliveNode().tables() .table("test") .keyValueView(Key.class, Val.class); var key = new Key(); key.int_col = 1; key.str_col = "1"; var val = new Val(); val.bool_col = true; val.date_col = LocalDate.now(); kvView.put(null, key, val);
Mind the order of primary key fields: the first and the last columns in table declaration. In that case, InvalidTypeException is thrown, because after IGNITE-19744 key columns are not grouped in the very beginning of the row anymore, but marshaller of embedded client still appends key columns first (see org.apache.ignite.internal.schema.marshaller.reflection.KvMarshallerImpl#marshal(K, V)).
Attachments
Issue Links
- blocks
-
IGNITE-21768 Wrong key column serialization in ClientKeyValueView
-
- Resolved
-
- is caused by
-
IGNITE-19744 Clean up IEP-54 leftovers
-
- Resolved
-
- links to