[jira] [Created] (CASSANDRA-14502) toDate() CQL function is instantiated for wrong argument type

2018-06-07 Thread Piotr Sarna (JIRA)
Piotr Sarna created CASSANDRA-14502:
---

 Summary: toDate() CQL function is instantiated for wrong argument 
type
 Key: CASSANDRA-14502
 URL: https://issues.apache.org/jira/browse/CASSANDRA-14502
 Project: Cassandra
  Issue Type: Bug
  Components: CQL
Reporter: Piotr Sarna
 Fix For: 4.0.x


{{toDate()}} function is instantiated to work for {{timeuuid}} and {{date}} 
types passed as an argument, instead of {{timeuuid}} and {{timestamp}}, as 
stated in this documentation: 
[http://cassandra.apache.org/doc/latest/cql/functions.html#datetime-functions]

As a result it's possible to convert a {{date}} into {{date}}, but not a 
{{timestamp}} into {{date}}, which is probably what was meant.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Created] (CASSANDRA-14377) Returning invalid JSON for NaN and Infinity float values

2018-04-11 Thread Piotr Sarna (JIRA)
Piotr Sarna created CASSANDRA-14377:
---

 Summary: Returning invalid JSON for NaN and Infinity float values
 Key: CASSANDRA-14377
 URL: https://issues.apache.org/jira/browse/CASSANDRA-14377
 Project: Cassandra
  Issue Type: Bug
  Components: CQL
Reporter: Piotr Sarna


After inserting special float values like NaN and Infinity into a table:

{{CREATE TABLE testme (t1 bigint, t2 float, t3 float, PRIMARY KEY (t1));}}
{{INSERT INTO testme (t1, t2, t3) VALUES (7, NaN, Infinity);}}

and returning them as JSON...

{{cqlsh:demodb> select json * from testme;}}
{{ [json]}}
{{--}}
{{ \{"t1": 7, "t2": NaN, "t3": Infinity}}}

 

... the result will not be validated (e.g. with 
[https://jsonlint.com/|https://jsonlint.com/)] ) because neither NaN nor 
Infinity is a valid JSON value. The consensus seems to be returning JSON's 
`null` in these cases, based on this article 
[https://stackoverflow.com/questions/1423081/json-left-out-infinity-and-nan-json-status-in-ecmascript]
 and other similar ones.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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