-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: optimize metadata on impala/hive
- Loading branch information
1 parent
4148a18
commit b620971
Showing
2 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,70 @@ | ||
================================================================================ | ||
Impala: Compute stats | ||
================================================================================ | ||
|
||
COMPUTE STATS my_table (col1); | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
(program | ||
(statement | ||
(keyword_compute) | ||
(keyword_stats) | ||
(table_reference | ||
(identifier)) | ||
(field | ||
(identifier)))) | ||
|
||
================================================================================ | ||
Impala: Compute incremental stats | ||
================================================================================ | ||
|
||
COMPUTE INCREMENTAL STATS my_table PARTITION (partition_col=col1); | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
(program | ||
(statement | ||
(keyword_compute) | ||
(keyword_incremental) | ||
(keyword_stats) | ||
(table_reference | ||
(identifier)) | ||
(keyword_partition) | ||
(table_option | ||
(identifier) | ||
(identifier)))) | ||
|
||
================================================================================ | ||
Hive: Analyze and Compute stats | ||
================================================================================ | ||
|
||
ANALYZE TABLE mytable | ||
PARTITION (partcol1=col1, partcol2=col2) | ||
COMPUTE STATISTICS | ||
FOR COLUMNS | ||
CACHE METADATA | ||
NOSCAN | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
(program | ||
(statement | ||
(keyword_analyze) | ||
(keyword_table) | ||
(table_reference | ||
(identifier)) | ||
(keyword_partition) | ||
(table_option | ||
(identifier) | ||
(identifier)) | ||
(table_option | ||
(identifier) | ||
(identifier)) | ||
(keyword_compute) | ||
(keyword_statistics) | ||
(keyword_for) | ||
(keyword_columns) | ||
(keyword_cache) | ||
(keyword_metadata) | ||
(keyword_noscan))) |