velox: json_parse: NUMBER_ERROR: Problem while parsing a number
Bug description
TEST_F(JsonFunctionsTest, jsonParse) {
const auto jsonParse = [&](std::optional<std::string> value) {
return evaluateOnce<StringView>("json_parse(c0)", value);
};
auto x = jsonParse("[233897314173811950000]");
}
VeloxUserError
Error Source: USER
Error Code: INVALID_ARGUMENT
Reason: Problem while parsing a number
Retriable: False
Context: json_parse(c0)
presto> select json_parse('[233897314173811950000]');
_col0
-------------------------
[233897314173811950000]
(1 row)
Meta: 20231215_004903_00428_65rj9
CC: @kevinwilfong @amitkdutta @kagamiori @kgpai @bikramSingh91 @duanmeng @laithsakka
System information
n/a
Relevant logs
No response
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Comments: 18 (11 by maintainers)
Commits related to this issue
- Fix json_parse for large number Summary: When the number is well-formated but outside the range of int64, we still allow such cases in `json_parse` so that we can cast them to floating point numbers ... — committed to Yuhta/velox by Yuhta 5 months ago
- Fix json_parse for large number (#8455) Summary: When the number is well-formated but outside the range of int64, we still allow such cases in `json_parse` so that we can cast them to floating point... — committed to Yuhta/velox by Yuhta 5 months ago
- Fix json_parse for large number (#8455) Summary: When the number is well-formated but outside the range of int64, we still allow such cases in `json_parse` so that we can cast them to floating point... — committed to Yuhta/velox by Yuhta 5 months ago
- Fix json_parse for large number (#8455) Summary: When the number is well-formated but outside the range of int64, we still allow such cases in `json_parse` so that we can cast them to floating point... — committed to Yuhta/velox by Yuhta 5 months ago
- Fix json_parse for large number (#8455) Summary: When the number is well-formated but outside the range of int64, we still allow such cases in `json_parse` so that we can cast them to floating point... — committed to Yuhta/velox by Yuhta 5 months ago
- Fix json_parse for large number (#8455) Summary: When the number is well-formated but outside the range of int64, we still allow such cases in `json_parse` so that we can cast them to floating point... — committed to Yuhta/velox by Yuhta 5 months ago
- Fix json_parse for large number (#8455) Summary: When the number is well-formated but outside the range of int64, we still allow such cases in `json_parse` so that we can cast them to floating point... — committed to Yuhta/velox by Yuhta 5 months ago
- Fix json_parse for large number (#8455) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/8455 When the number is well-formated but outside the range of int64, we still... — committed to codyschierbeck/velox by Yuhta 5 months ago
@Yuhta It is possible to build simdjson so that it will skip number parsing…
SIMDJSON_SKIPNUMBERPARSING
but that may not be what you want. We could create some macro that meets your needs… It is not very difficult engineering.The failure comes around here…
https://github.com/simdjson/simdjson/blob/ebd09cb2a3ab421f04b404338c01b593ade5a08c/include/simdjson/generic/numberparsing.h#L591
We could add a VELOX-specific macro. Of course, it depends on what exactly you want to do.
(If you are using a single-header version of the library, you will find the same code… it just gets aggregated.)