Repository navigation
support flag kParseFloatAndOverflowNumAsNumStr to parse float as string - #156
Merged
Merged
Conversation
zhangxffff
reviewed
Nov 12, 2026
howz97
force-pushed
the
parse_float_as_str
branch
from
November 12, 2026 12:30
89132cd to
b1ff9a6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #156 +/- ##
==========================================
- Coverage 69.67% 69.43% -0.24%
==========================================
Files 27 27
Lines 3706 3707 +1
Branches 1189 1189
==========================================
- Hits 2582 2574 -8
+ Misses 211 203 -8
- Partials 913 930 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hive JsonToMapUDF 的实现是不解析 double ,直接当成 string 进行序列化,所以得到结果 1e10 这样非标准的格式。
而之前的bolt是依赖解析 flag kParseOverflowNumAsNumStr 在语义上的 bug 所以能通过测试。看命名应该是仅把 overflow 的 数字当成 string 对待,但是 bug 导致 所有数字都被当成 string 对待,恰好跟 hive udf 的实现一致了。
现在 sonic master 修复了 kParseOverflowNumAsNumStr 的语义,1e10 还没有 overflow,所以 1e10 被解析成 double 再序列化就得到了 10000000000 。
如果要坚持使用 sonic master ,就需要增加一个 kParseNumAsNumStr 把float都当成 string 解析。