-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Extraction float64 value from JSON fails #18099
Copy link
Copy link
Closed
Labels
questionQuestion?Question?
Description
Describe the bug
The JSONExtract functions can't extract the float64 value
How to reproduce
SELECT
JSONExtract(json, 'value', 'String') str,
JSONExtract(json, 'value', 'Float64') int,
JSONExtractRaw(json) raw,
type
FROM (
SELECT '{"value":99999999999999999999}' json, 'float' type
UNION ALL
SELECT '{"value":"99999999999999999999"}' json, 'string' type
);
-- Float64
SELECT toTypeName(99999999999999999999);- Which ClickHouse server version to use
20.11.4.13
Expected behavior
ACTUAL
+----------------------+-----+----------------------------------+--------+
| str | int | raw | type |
+----------------------+-----+----------------------------------+--------+
| | 0 | | float |
+----------------------+-----+----------------------------------+--------+
| 99999999999999999999 | 0 | {"value":"99999999999999999999"} | string |
+----------------------+-----+----------------------------------+--------+
EXPECTED
+----------------------+----------------------+----------------------------------+--------+
| str | int | raw | type |
+----------------------+----------------------+----------------------------------+--------+
| 99999999999999999999 | 99999999999999999999 | {"value":99999999999999999999} | float |
+----------------------+----------------------+----------------------------------+--------+
| 99999999999999999999 | 0 | {"value":"99999999999999999999"} | string |
+----------------------+----------------------+----------------------------------+--------+
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionQuestion?Question?