The initial implementation was developed on Cassandra 1.2.1 server (xxx.xxx.11.221) and the following SQL works:
UPDATE "issue_ks"."issue_10020" SET "c2"='' WHERE "c1"='key-1';
Above SQL does not work on Cassandra 1.2.3 server (xxx.xxx.11.44) and 1.2.4 server (xxx.xxx.11.49), the following error is generated:
Bad Request: Invalid STRING constant () for c2 of type int
text could not be lexed at line 1, char 8
On 1.2.1 server, SET "c2"='' (two single quotes) is the way to set an integer column to NULL; apparently it does not work for 1.2.3+ servers. Need to do some study to figure out how to set a column to NULL for all of Cassandra supported data types on 1.2.3+ servers.
The initial implementation was developed on Cassandra 1.2.1 server (xxx.xxx.11.221) and the following SQL works:
UPDATE "issue_ks"."issue_10020" SET "c2"='' WHERE "c1"='key-1';
Above SQL does not work on Cassandra 1.2.3 server (xxx.xxx.11.44) and 1.2.4 server (xxx.xxx.11.49), the following error is generated:
Bad Request: Invalid STRING constant () for c2 of type int
text could not be lexed at line 1, char 8
On 1.2.1 server, SET "c2"='' (two single quotes) is the way to set an integer column to NULL; apparently it does not work for 1.2.3+ servers. Need to do some study to figure out how to set a column to NULL for all of Cassandra supported data types on 1.2.3+ servers.
Fixed:
14.0 - SVN r34121/14.0.0-rc-29
trunk - SVN r34122/15.0.0-dev-16
I tried INSERT/UPDATE statements for all of Cassandra data types (except counter data type which has special meaning) to create/update a column to NULL on 1.2.3 server (xxx.xxx.11.44) and 1.2.4 server (xxx.xxx.11.49). Here is the summary to set a column to NULL:
(A) 1.2.1 server:
(a1) use empty string for non-collection types: e.g. INSERT INTO table(c1, c2) VALUES(1, ''); UPDATE table SET c2='' WHERE c1=1
(a2) for collection types: use [], {}, {} for list, map, set respectively
(B) 1.2.3 server:
(b1) Implementation (A) works on 1.2.3 for the following data types: inet, collection types (list, map and set), timestamp.
(b2) For types not listed in (b1), it seems that the only way to set a column to NULL is to delete that column from a row as:
DELETE column FROM table WHERE key_column = value;
(C) 1.2.4 server:
(c1) Same as 1.2.3 server.
(c2) 1.2.4 supports NULL keyword which can be applied to all of supported data types (1.2.3 does not support NULL keyword).
1.2.1, 1.2.3, 1.2.4 servers all have same major and minor version numbers, the difference is the last one (patch version?). In current ADS implementation, I think we don't support server version comparison at patch level. This means I cannot tell Cassandra 1.2.1 from 1.2.3/4 in ADS. Hence, I made changes to support only 1.2.4 server but not 1.2.1 and 1.2.3. If this is not acceptable, please reopen this issue.
Fixed:
14.0 - SVN r34121/14.0.0-rc-29
trunk - SVN r34122/15.0.0-dev-16
I tried INSERT/UPDATE statements for all of Cassandra data types (except counter data type which has special meaning) to create/update a column to NULL on 1.2.3 server (xxx.xxx.11.44) and 1.2.4 server (xxx.xxx.11.49). Here is the summary to set a column to NULL:
(A) 1.2.1 server:
(a1) use empty string for non-collection types: e.g. INSERT INTO table(c1, c2) VALUES(1, ''); UPDATE table SET c2='' WHERE c1=1
(a2) for collection types: use [], {}, {} for list, map, set respectively
(B) 1.2.3 server:
(b1) Implementation (A) works on 1.2.3 for the following data types: inet, collection types (list, map and set), timestamp.
(b2) For types not listed in (b1), it seems that the only way to set a column to NULL is to delete that column from a row as:
DELETE column FROM table WHERE key_column = value;
(C) 1.2.4 server:
(c1) Same as 1.2.3 server.
(c2) 1.2.4 supports NULL keyword which can be applied to all of supported data types (1.2.3 does not support NULL keyword).
1.2.1, 1.2.3, 1.2.4 servers all have same major and minor version numbers, the difference is the last one (patch version?). In current ADS implementation, I think we don't support server version comparison at patch level. This means I cannot tell Cassandra 1.2.1 from 1.2.3/4 in ADS. Hence, I made changes to support only 1.2.4 server but not 1.2.1 and 1.2.3. If this is not acceptable, please reopen this issue.
We are using 1.2.8 Server and that supports NULL keyword
We are using 1.2.8 Server and that supports NULL keyword
> Fixed:
> 14.0 - SVN r34121/14.0.0-rc-29
> trunk - SVN r34122/15.0.0-dev-16
This fix supports only 1.2.4 server, i.e. supports NULL keyword.
> Fixed:
> 14.0 - SVN r34121/14.0.0-rc-29
> trunk - SVN r34122/15.0.0-dev-16
This fix supports only 1.2.4 server, i.e. supports NULL keyword.
Fix above (SVN r34121/14.0.0-rc-29) supports NULL keyword and should work for 1.2.4 or newer version servers. 1.2.1 and 1.2.3 servers are no longer supported; if 1.2.3 or older versions need to be supported, please reopen this issue.
Fix above (SVN r34121/14.0.0-rc-29) supports NULL keyword and should work for 1.2.4 or newer version servers. 1.2.1 and 1.2.3 servers are no longer supported; if 1.2.3 or older versions need to be supported, please reopen this issue.
Verified in 14.0.0-rc-36 for Cassandra 1.2.9
Verified in 14.0.0-rc-36 for Cassandra 1.2.9
Issue #10020 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 14.0.0-rc-29/15.0.0-dev-16 |
No time estimate |
CassUtil.getNullText needs to be enhanced to handle integer type.