[ 
https://issues.apache.org/jira/browse/IGNITE-21797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maksim Zhuravkov reassigned IGNITE-21797:
-----------------------------------------

    Assignee: Maksim Zhuravkov

> Column's type mismatch during marshalling of pojo (embedded API)
> ----------------------------------------------------------------
>
>                 Key: IGNITE-21797
>                 URL: https://issues.apache.org/jira/browse/IGNITE-21797
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Konstantin Orlov
>            Assignee: Maksim Zhuravkov
>            Priority: Blocker
>              Labels: ignite-3
>             Fix For: 3.0.0-beta2
>
>
> Take a look at the scenario below:
> {code:java}
>     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);
> {code}
> 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)}}).  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to