Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Fixed
-
2.2.14, 3.0.18, 3.11.4, 4.0-alpha1, 4.0
-
None
-
Low
Description
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/ ) 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.