[fix](zonemap) Make DOUBLE/FLOAT zone map bounds usable ( #65302 #67341 #67431) - #67440
Open
csun5285 wants to merge 1 commit into
Open
[fix](zonemap) Make DOUBLE/FLOAT zone map bounds usable ( #65302 #67341 #67431)#67440csun5285 wants to merge 1 commit into
csun5285 wants to merge 1 commit into
Conversation
Three problems compound on FLOAT and DOUBLE zone maps, and none of the fixes for them on master can be picked here: the storage layer moved to be/src/storage between 4.0 and 4.1, and the read path is a private ColumnReader::_parse_zone_map rather than ZoneMap::from_proto. Bounds are written with digits10 + 1 significant digits, which does not round-trip: DBL_MAX reads back as infinity, and FLT_MAX loses precision and reads back smaller than it was written, so SELECT ... WHERE v = FLT_MAX prunes away the row that holds it. Write the shortest form that round-trips instead, in the zone map serialization only, leaving Field::to_string alone for its other callers (apache#65302 on master). A bound that fails to parse fails the whole scan. A nullable serde also turns such a failure into a null Field, and from_olap_string lets infinity and NaN through, neither of which can take part in a comparison. Mark those zone maps pass_all so they prune nothing, and let the scan run (apache#67341 on master). NaN and infinity only set the has_nan/has_positive_inf/has_negative_inf flags, never min/max, so a page holding nothing else leaves both at the values add_values() starts from: min = DBL_MAX and max = -DBL_MAX. Those are written out as if they were data, and the flags stand in for at most one side, so reading them back reports a DBL_MAX that is nowhere in the page. On data written before 4.0 there is no flag at all and both bounds are used, which prunes the page away entirely: 25 rows of NaN return 0 for WHERE v > 5. Mark the zone map pass_all when the bounds come back reversed, which only FLOAT and DOUBLE can do, and do the same in flush() and finish() so newly written pages record that they have no bounds. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TPTGDEAgu5sQVYYvfvyTJz
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
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.
What problem does this PR solve?
Pick from master: #65302 #67341 #67431
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)