Зажечь ошибки, чтобы создать таблицу с датой в качестве первичного ключа - PullRequest
0 голосов
/ 19 мая 2018

Давайте попробуем создать таблицу, например, с отметкой времени в качестве первичного ключа:

0: jdbc:ignite:thin://127.0.0.1/> create table t2(i timestamp primary key, i2 date);
No rows affected (0.099 seconds)
0: jdbc:ignite:thin://127.0.0.1/> INSERT INTO T2 (I, I2) VALUES (timestamp '2017-10-12 21:22:24',timestamp '2017-10-12 21:22:23');
1 row affected (0.009 seconds)
0: jdbc:ignite:thin://127.0.0.1/> select * from t2;
+--------------------------------+--------------------------------+
|               I                |               I2               |
+--------------------------------+--------------------------------+
| 2017-10-12 21:22:23.0          | Fri Nov 11 00:00:00 MSK 2011   |
| 2017-10-12 21:22:24.0          | Thu Oct 12 00:00:00 MSK 2017   |
+--------------------------------+--------------------------------+

Как вы можете видеть выше, все в порядке.Теперь давайте попробуем создать таблицу с датой в качестве первичного ключа:

0: jdbc:ignite:thin://127.0.0.1/> create table t3 (i date primary key, i2 int);
Error: class org.apache.ignite.IgniteCheckedException: Failed to find value class in the node classpath (use default marshaller to enable binary objects) : SQL_PUBLIC_T3_203867a5_800b_4821_9690_e8902ca7b8e1 (state=50000,code=0)
java.sql.SQLException: class org.apache.ignite.IgniteCheckedException: Failed to find value class in the node classpath (use default marshaller to enable binary objects) : SQL_PUBLIC_T3_203867a5_800b_4821_9690_e8902ca7b8e1
    at org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:648)
    at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:130)
    at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:299)
    at sqlline.Commands.execute(Commands.java:823)
    at sqlline.Commands.sql(Commands.java:733)
    at sqlline.SqlLine.dispatch(SqlLine.java:795)
    at sqlline.SqlLine.begin(SqlLine.java:668)
    at sqlline.SqlLine.start(SqlLine.java:373)
    at sqlline.SqlLine.main(SqlLine.java:265)

Также я получаю эту ошибку в журнале: https://pastebin.com/wLYiF0x0

1 Ответ

0 голосов
/ 22 мая 2018

Полагаю, это будет исправлено в ближайшее время - https://issues.apache.org/jira/browse/IGNITE-8552

Это работает, если вы добавляете типы ключей и значений в команду ddl:

create table t2(i timestamp primary key, i2 date
) WITH "key_type=KeyType, value_type=ValueType";
...