[ 
https://issues.apache.org/jira/browse/CASSANDRA-13592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16068410#comment-16068410
 ] 

ZhaoYang edited comment on CASSANDRA-13592 at 6/29/17 2:53 PM:
---------------------------------------------------------------

Thanks.. Yes, it's better solve it within type.toJSONString

I will add test the specification of type.toJSONString.  all should not change 
buffer position.



was (Author: jasonstack):
Thanks.. Yes, it's better solve it within type.toJSONString

I will add test the specification of type.toJSONString.  all should not change 
buffer position.

While adding test cases for DurationType, I found following error, maybe 
related to 
[cassandra-11873|https://issues.apache.org/jira/browse/CASSANDRA-11873]

{code}
CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': 1};
CREATE TABLE ks.cf ( key text PRIMARY KEY , d duration );

// following CQL will fail, due to `JSON_OBJECT_MAPPER.readValue(json, 
Object.class);` returning `-2`
INSERT INTO ks.cf (key , d ) VALUES ( '22', fromJson('-2h1m'));  

// following CQL will pass,  value of duration is taken from the json map of 
`JSON_OBJECT_MAPPER.readValue(json, Map.class);`
INSERT INTO ks.cf JSON '{ "key":"111", "d":"-2h9m"}';  
{code}


> Null Pointer exception at SELECT JSON statement
> -----------------------------------------------
>
>                 Key: CASSANDRA-13592
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13592
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>         Environment: Debian Linux
>            Reporter: Wyss Philipp
>            Assignee: ZhaoYang
>              Labels: beginner
>         Attachments: system.log
>
>
> A Nulll pointer exception appears when the command
> {code}
> SELECT JSON * FROM examples.basic;
> ---MORE---
> <Error from server: code=0000 [Server error] 
> message="java.lang.NullPointerException">
> Examples.basic has the following description (DESC examples.basic;):
> CREATE TABLE examples.basic (
>     key frozen<tuple<uuid, int>> PRIMARY KEY,
>     wert text
> ) WITH bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '64', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND dclocal_read_repair_chance = 0.1
>     AND default_time_to_live = 0
>     AND gc_grace_seconds = 864000
>     AND max_index_interval = 2048
>     AND memtable_flush_period_in_ms = 0
>     AND min_index_interval = 128
>     AND read_repair_chance = 0.0
>     AND speculative_retry = '99PERCENTILE';
> {code}
> The error appears after the ---MORE--- line.
> The field "wert" has a JSON formatted string.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to