-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-29524: Missing num_nulls statistic for partition columns #6410
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
Draft
tanishq-chugh
wants to merge
1
commit into
apache:master
Choose a base branch
from
tanishq-chugh:HIVE-29524
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+176
−0
Draft
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| CREATE TABLE emp (eid INT, ename STRING) partitioned by (bdate INT, location STRING); | ||
|
|
||
| INSERT INTO emp | ||
| VALUES (1, 'Bob', 20200101, 'Paris'), | ||
| (2, 'Alice', 20200102, 'Paris'), | ||
| (3, 'Sam', 20200103, null), | ||
| (4, 'John', null, 'New York'), | ||
| (5, 'Jane', null, null), | ||
| (6, 'Tom', null, 'New York'), | ||
| (7, null, 20200103, 'New York'), | ||
| (8, null, 20200103, 'Paris'), | ||
| (null, 'Tom', 20200109, null), | ||
| (null, 'Jane', 20200110, null); | ||
|
|
||
| DESCRIBE FORMATTED emp eid; | ||
| DESCRIBE FORMATTED emp ename; | ||
| DESCRIBE FORMATTED emp bdate; | ||
| DESCRIBE FORMATTED emp location; |
139 changes: 139 additions & 0 deletions
139
ql/src/test/results/clientpositive/llap/part_num_nulls.q.out
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,139 @@ | ||
| PREHOOK: query: CREATE TABLE emp (eid INT, ename STRING) partitioned by (bdate INT, location STRING) | ||
| PREHOOK: type: CREATETABLE | ||
| PREHOOK: Output: database:default | ||
| PREHOOK: Output: default@emp | ||
| POSTHOOK: query: CREATE TABLE emp (eid INT, ename STRING) partitioned by (bdate INT, location STRING) | ||
| POSTHOOK: type: CREATETABLE | ||
| POSTHOOK: Output: database:default | ||
| POSTHOOK: Output: default@emp | ||
| PREHOOK: query: INSERT INTO emp | ||
| VALUES (1, 'Bob', 20200101, 'Paris'), | ||
| (2, 'Alice', 20200102, 'Paris'), | ||
| (3, 'Sam', 20200103, null), | ||
| (4, 'John', null, 'New York'), | ||
| (5, 'Jane', null, null), | ||
| (6, 'Tom', null, 'New York'), | ||
| (7, null, 20200103, 'New York'), | ||
| (8, null, 20200103, 'Paris'), | ||
| (null, 'Tom', 20200109, null), | ||
| (null, 'Jane', 20200110, null) | ||
| PREHOOK: type: QUERY | ||
| PREHOOK: Input: _dummy_database@_dummy_table | ||
| PREHOOK: Output: default@emp | ||
| POSTHOOK: query: INSERT INTO emp | ||
| VALUES (1, 'Bob', 20200101, 'Paris'), | ||
| (2, 'Alice', 20200102, 'Paris'), | ||
| (3, 'Sam', 20200103, null), | ||
| (4, 'John', null, 'New York'), | ||
| (5, 'Jane', null, null), | ||
| (6, 'Tom', null, 'New York'), | ||
| (7, null, 20200103, 'New York'), | ||
| (8, null, 20200103, 'Paris'), | ||
| (null, 'Tom', 20200109, null), | ||
| (null, 'Jane', 20200110, null) | ||
| POSTHOOK: type: QUERY | ||
| POSTHOOK: Input: _dummy_database@_dummy_table | ||
| POSTHOOK: Output: default@emp | ||
| POSTHOOK: Output: default@emp@bdate=20200101/location=Paris | ||
| POSTHOOK: Output: default@emp@bdate=20200102/location=Paris | ||
| POSTHOOK: Output: default@emp@bdate=20200103/location=New York | ||
| POSTHOOK: Output: default@emp@bdate=20200103/location=Paris | ||
| POSTHOOK: Output: default@emp@bdate=20200103/location=__HIVE_DEFAULT_PARTITION__ | ||
| POSTHOOK: Output: default@emp@bdate=20200109/location=__HIVE_DEFAULT_PARTITION__ | ||
| POSTHOOK: Output: default@emp@bdate=20200110/location=__HIVE_DEFAULT_PARTITION__ | ||
| POSTHOOK: Output: default@emp@bdate=__HIVE_DEFAULT_PARTITION__/location=New York | ||
| POSTHOOK: Output: default@emp@bdate=__HIVE_DEFAULT_PARTITION__/location=__HIVE_DEFAULT_PARTITION__ | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200101,location=Paris).eid SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200101,location=Paris).ename SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200102,location=Paris).eid SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200102,location=Paris).ename SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200103,location=New York).eid SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200103,location=New York).ename SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200103,location=Paris).eid SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200103,location=Paris).ename SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200103,location=__HIVE_DEFAULT_PARTITION__).eid SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200103,location=__HIVE_DEFAULT_PARTITION__).ename SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200109,location=__HIVE_DEFAULT_PARTITION__).eid SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200109,location=__HIVE_DEFAULT_PARTITION__).ename SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200110,location=__HIVE_DEFAULT_PARTITION__).eid SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=20200110,location=__HIVE_DEFAULT_PARTITION__).ename SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=__HIVE_DEFAULT_PARTITION__,location=New York).eid SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=__HIVE_DEFAULT_PARTITION__,location=New York).ename SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=__HIVE_DEFAULT_PARTITION__,location=__HIVE_DEFAULT_PARTITION__).eid SCRIPT [] | ||
| POSTHOOK: Lineage: emp PARTITION(bdate=__HIVE_DEFAULT_PARTITION__,location=__HIVE_DEFAULT_PARTITION__).ename SCRIPT [] | ||
| PREHOOK: query: DESCRIBE FORMATTED emp eid | ||
| PREHOOK: type: DESCTABLE | ||
| PREHOOK: Input: default@emp | ||
| POSTHOOK: query: DESCRIBE FORMATTED emp eid | ||
| POSTHOOK: type: DESCTABLE | ||
| POSTHOOK: Input: default@emp | ||
| col_name eid | ||
| data_type int | ||
| min 1 | ||
| max 8 | ||
| num_nulls 2 | ||
| distinct_count 8 | ||
| avg_col_len | ||
| max_col_len | ||
| num_trues | ||
| num_falses | ||
| bit_vector HL | ||
| comment from deserializer | ||
| COLUMN_STATS_ACCURATE {\"COLUMN_STATS\":{\"eid\":\"true\"}} | ||
| PREHOOK: query: DESCRIBE FORMATTED emp ename | ||
| PREHOOK: type: DESCTABLE | ||
| PREHOOK: Input: default@emp | ||
| POSTHOOK: query: DESCRIBE FORMATTED emp ename | ||
| POSTHOOK: type: DESCTABLE | ||
| POSTHOOK: Input: default@emp | ||
| col_name ename | ||
| data_type string | ||
| min | ||
| max | ||
| num_nulls 2 | ||
| distinct_count 6 | ||
| avg_col_len 5.0 | ||
| max_col_len 5 | ||
| num_trues | ||
| num_falses | ||
| bit_vector HL | ||
| comment from deserializer | ||
| COLUMN_STATS_ACCURATE {\"COLUMN_STATS\":{\"ename\":\"true\"}} | ||
| PREHOOK: query: DESCRIBE FORMATTED emp bdate | ||
| PREHOOK: type: DESCTABLE | ||
| PREHOOK: Input: default@emp | ||
| POSTHOOK: query: DESCRIBE FORMATTED emp bdate | ||
| POSTHOOK: type: DESCTABLE | ||
| POSTHOOK: Input: default@emp | ||
| col_name bdate | ||
| data_type int | ||
| min 20200101 | ||
| max 20200110 | ||
| num_nulls 3 | ||
| distinct_count 6 | ||
| avg_col_len | ||
| max_col_len | ||
| num_trues | ||
| num_falses | ||
| bit_vector | ||
| comment | ||
| COLUMN_STATS_ACCURATE {\"COLUMN_STATS\":{\"bdate\":\"true\"}} | ||
| PREHOOK: query: DESCRIBE FORMATTED emp location | ||
| PREHOOK: type: DESCTABLE | ||
| PREHOOK: Input: default@emp | ||
| POSTHOOK: query: DESCRIBE FORMATTED emp location | ||
| POSTHOOK: type: DESCTABLE | ||
| POSTHOOK: Input: default@emp | ||
| col_name location | ||
| data_type string | ||
| min | ||
| max | ||
| num_nulls 4 | ||
| distinct_count 3 | ||
| avg_col_len 100.0 | ||
| max_col_len 100 | ||
| num_trues | ||
| num_falses | ||
| bit_vector | ||
| comment | ||
| COLUMN_STATS_ACCURATE {\"COLUMN_STATS\":{\"location\":\"true\"}} |
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.
I am wondering if we could take advantage of the existing
StatsUtils#getNumRowsmethod to some extend. At the very least we may be able to reuse some existing classes such asorg.apache.hadoop.hive.ql.stats.BasicStats.