-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-27448: Hive Iceberg: Merge column stats #4431
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1df3b64
HIVE-27448: Hive Iceberg: Merge column stats
826ad64
Addressed review comments
612ae9d
Addressed review comments
simhadri-g ad9eb51
addressed review comments
simhadri-g 0ff43e1
addressed review comments
simhadri-g 15ba46d
addressed review comments
simhadri-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
21 changes: 21 additions & 0 deletions
21
iceberg/iceberg-handler/src/test/queries/positive/puffin_col_stats.q
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| -- Mask random uuid | ||
| --! qt:replace:/(\s+uuid\s+)\S+(\s*)/$1#Masked#$2/ | ||
| set hive.stats.autogather=true; | ||
| set hive.stats.column.autogather=true; | ||
|
|
||
| set hive.iceberg.stats.source=iceberg; | ||
| drop table if exists tbl_ice_puffin; | ||
| create external table tbl_ice_puffin(a int, b string, c int) stored by iceberg tblproperties ('format-version'='2'); | ||
| insert into tbl_ice_puffin values (1, 'one', 50), (2, 'two', 51),(2, 'two', 51),(2, 'two', 51), (3, 'three', 52), (4, 'four', 53), (5, 'five', 54), (111, 'one', 55), (333, 'two', 56); | ||
| desc formatted tbl_ice_puffin a; | ||
| desc formatted tbl_ice_puffin c; | ||
| explain select * from tbl_ice_puffin order by a, b, c; | ||
| insert into tbl_ice_puffin values (1000, 'one', 1000), (5000, 'two', 5000); | ||
| desc formatted tbl_ice_puffin a; | ||
| desc formatted tbl_ice_puffin c; | ||
| explain select * from tbl_ice_puffin order by a, b, c; | ||
| insert into tbl_ice_puffin values (10, 'one', 100000), (5000, 'two', 510000); | ||
| explain select * from tbl_ice_puffin order by a, b, c; | ||
| desc formatted tbl_ice_puffin a; | ||
| desc formatted tbl_ice_puffin c; | ||
| -- Result: a = (min: 1, max: 5000) , c =(min: 50, max: 51000) |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this change?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect it is removed here because of:
HIVE-23846 : Avoid unnecessary serialization and deserialization of bitvectors
ps: HIVE-17286 introduced HL to avoid expensive string serialisation for ndv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't get, how adding minor delta stats merge caused that behavior change? @kasakrisz any hints?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick search and
bit_vectorhasHLin case of non iceberg tables in our q test outs when the column stats present for that column.@simhadri-g Could you please look into why was it removed in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, thanks @kasakrisz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A alter table command is run during the doCommit Stage, which seems to unnecessarily overwrite the bit_vector . This should be fixed for iceberg tables. I have created follow up jira to address it.
https://issues.apache.org/jira/browse/HIVE-27528
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simhadri-g, please add a link to a follow-up ticket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://issues.apache.org/jira/browse/HIVE-27528