【发布时间】:2016-07-16 07:58:34
【问题描述】:
我正在尝试实现 cassandra SE 和 MariaDB 的互操作性。在cqlsh 中,我可以使用复合键创建表。当我在 mariadb 中尝试相同的操作时,我收到错误 ERROR 1070 (42000): Too many key parts specified; max 1 parts allowed。
这是我在cqlsh中使用的代码:
cqlsh:mariadbtest> create table test (test1 int, test2 bigint, test3 varchar, primary key (test1, test2)) with compact STORAGE;
在Mariadb:
MariaDB [test]> set global cassandra_default_thrift_host='localhost';
MariaDB [test]> create table random (test1 int(5), test2 bigint(5), test3 varchar(20), PRIMARY KEY (test1, test2)) engine=cassandra keyspace='historian' thrift_host='localhost' column_family='test';
ERROR 1070 (42000): Too many key parts specified; max 1 parts allowed
当我使用单列作为主键时,它可以正常工作,没有错误。请帮助我解决复合键问题。 任何帮助将不胜感激。
【问题讨论】: