[
https://issues.apache.org/jira/browse/IMPALA-13066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18037652#comment-18037652
]
ASF subversion and git services commented on IMPALA-13066:
----------------------------------------------------------
Commit 760eb4f2fa3f7470ae097067d2320dfde6e50ac6 in impala's branch
refs/heads/master from Arnab Karmakar
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=760eb4f2f ]
IMPALA-13066: Extend SHOW CREATE TABLE to include stats and partitions
Adds a new WITH STATS option to the SHOW CREATE TABLE statement to
emit additional SQL statements for recreating table statistics and
partitions.
When specified, Impala outputs:
- Base CREATE TABLE statement.
- ALTER TABLE ... SET TBLPROPERTIES for table-level stats.
- ALTER TABLE ... SET COLUMN STATS for all non-partition columns,
restoring column stats.
- For partitioned tables:
- ALTER TABLE ... ADD PARTITION statements to recreate partitions.
- Per-partition ALTER TABLE ... PARTITION (...) SET TBLPROPERTIES
to restore partition-level stats.
Partition output is limited by the PARTITION_LIMIT query option
(default 1000). Setting PARTITION_LIMIT=0 includes all partitions and
emits a warning if the limit is exceeded.
Tests added to verify correctness of emitted statements. Default
behavior of SHOW CREATE TABLE remains unchanged for compatibility.
Change-Id: I87950ae9d9bb73cb2a435cf5bcad076df1570dc2
Reviewed-on: http://gerrit.cloudera.org:8080/23536
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> SHOW CREATE TABLE with stats and partitions
> -------------------------------------------
>
> Key: IMPALA-13066
> URL: https://issues.apache.org/jira/browse/IMPALA-13066
> Project: IMPALA
> Issue Type: New Feature
> Components: Backend, Frontend
> Reporter: Quanlong Huang
> Assignee: Arnab Karmakar
> Priority: Critical
> Labels: ramp-up
>
> SHOW CREATE TABLE produces the statement to create the table. In practise, we
> also want the column stats and partitions. It'd be helpful to add an option
> for also producing the ADD PARTITION and SET COLUMN STATS statements. E.g.
> {code:sql}
> SHOW CREATE TABLE my_tbl WITH STATS;{code}
> produces
> {code:sql}
> CREATE TABLE my_tbl ...;
> ALTER TABLE my_tbl ADD PARTITION ...;
> ALTER TABLE my_tbl PARTITION (...) SET TBLPROPERTIES('numRows'='30000',
> 'STATS_GENERATED_VIA_STATS_TASK'='true');
> ALTER TABLE my_tbl SET COLUMN STATS c1
> ('numDVs'='19','numNulls'='0','maxSize'='8','avgSize'='8');
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]