ORC-1725: [C++] Fix BYTE statistics on platforms with unsigned 'char'#1947
Closed
al13n321 wants to merge 3 commits intoapache:mainfrom
Closed
ORC-1725: [C++] Fix BYTE statistics on platforms with unsigned 'char'#1947al13n321 wants to merge 3 commits intoapache:mainfrom
al13n321 wants to merge 3 commits intoapache:mainfrom
Conversation
Member
|
Thanks for the fix! Could you please use the original PR template? |
Member
|
cc @ffacs |
Contributor
Author
Edited. |
Contributor
|
Thank you for making the PR @al13n321. It seems there are no tests to cover the case. Could you please add a little unit test? |
Contributor
Author
|
Added a minimal test. It fails without the fix as expected: Would be good to properly test statistics, with all data types, row index statistics, random values, random stripe and row index sizes, etc, but that's outside the scope of this PR. |
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 changes were proposed in this pull request?
Calculate min/max statistics for columns of type BYTE using
signed charinstead ofchartype (C++).Why are the changes needed?
charcan be signed or unsigned, depending on target platform and compiler flags, but the statistics in the ORC file should always treat numbers as signed. Specifically, it was behaving incorrectly on ARM becausecharis unsigned there.How was this patch tested?
Tested as part of ClickHouse here: ClickHouse/ClickHouse#64563 .
Let me know if I should add a unit test or something (though presumably there are already unit tests for this, they just don't run on ARM in CI?)Added a small test in TestWriter.cc reproducing the problem.Was this patch authored or co-authored using generative AI tooling?
No