CAMELCASE列名称中的CratedB Crash vs JDBC中的名称



cratedB是否允许具有上限或骆驼盒属性名称的对象列?我有这样的桌子:

create table objecttest(
 age integer,
 name string,
 attrs object
);

使用插入语句:

insert into objecttest (age,name,attrs) values (30,'harry',{address = '123  street', city = 'city', IPaddress = '10.0.0.1'});

...崩溃导致:

cr> select * from objecttest;
+-----+---------------------------------------------------------------------+--------+
| age | attrs                                                               | name   |
+-----+---------------------------------------------------------------------+--------+
|  30 | {"address": "123  street", "city": "city", "ipaddress": "10.0.0.1"} | harry  |
+-----+---------------------------------------------------------------------+--------+
SELECT 1 row in set (0.005 sec)

...在CratedB的JDBC驱动程序中导致:

cr> select * from objecttest;
+-----+---------------------------------------------------------------------+-------+
| age | attrs                                                               | name  |
+-----+---------------------------------------------------------------------+-------+
|  30 | {"address": "123  street", "city": "city", "ipaddress": "10.0.0.1"} | harry |
|  30 | {"IPaddress": "10.0.0.1", "address": "123  street", "city": "city"} | harry |
+-----+---------------------------------------------------------------------+-------+
SELECT 2 rows in set (0.004 sec)

iPaddress现在的拼写不同。这是Crate-JDBC中的错误吗?

无引号,cratedB将所有列名称视为不敏感的(较低案例),因此应引用任何列以保留壳体。另一方面,CratedB的JDBC驱动程序将自动引用列名称,这意味着在那里执行的插入语句将按照代码中的书面形式使用。崩溃/admin ui/...发行时将使用保留套管:

insert into objecttest (age,name,attrs) values (30,'harry',{address = '123  street', city = 'city', "IPaddress" = '10.0.0.1'});

您将获得相同的结果,就好像用Crate-jdbc插入。

更多关于此处结构的信息。

欢呼!

相关内容

  • 没有找到相关文章

最新更新