Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow inaccurate conversion from double to float in function JSONExtract beacuse the users want that #19960

Conversation

alexey-milovidov
Copy link
Member

@alexey-milovidov alexey-milovidov commented Feb 2, 2021

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
If user calls JSONExtract function with Float32 type requested, allow inaccurate conversion to the result type. For example the number 0.1 in JSON is double precision and is not representable in Float32, but the user still wants to get it. Previous versions return 0 for non-Nullable type and NULL for Nullable type to indicate that conversion is imprecise. The logic was 100% correct but it was surprising to users and leading to questions. This closes #13962.

@robot-clickhouse robot-clickhouse added the pr-improvement Pull request with some product improvements label Feb 2, 2021
@alexey-milovidov alexey-milovidov changed the title Allow conversion from double to float in function JSONExtract beacuse the users want that Allow inaccurate conversion from double to float in function JSONExtract beacuse the users want that Feb 2, 2021
@alexey-milovidov
Copy link
Member Author

AST fuzzer (MSan) — SUMMARY: MemorySanitizer: use-of-uninitialized-value (/workspace/clickhouse+0x8d6ec9e) in memcmp

#19967

@alexey-milovidov alexey-milovidov merged commit 695e280 into master Feb 2, 2021
@alexey-milovidov alexey-milovidov deleted the json-extract-inaccurate-conversion-from-double-to-float branch February 2, 2021 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-improvement Pull request with some product improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSONExtract returns 0 for numbers with floating-point for type float / Float32
3 participants