[
https://issues.apache.org/jira/browse/SPARK-44698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Qi Zhu resolved SPARK-44698.
----------------------------
Resolution: Not A Problem
Sorry i misunderstand, the create table like don't need to copy data actually!
> Create table like other table should also copy table stats.
> -----------------------------------------------------------
>
> Key: SPARK-44698
> URL: https://issues.apache.org/jira/browse/SPARK-44698
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.4.1, 4.0.0
> Reporter: Qi Zhu
> Priority: Major
>
> For example:
> describe table extended tbl;
> col0 int
> col1 int
> col2 int
> col3 int
> Detailed Table Information
> Catalog spark_catalog
> Database default
> Table tbl
> Owner zhuqi
> Created Time Mon Aug 07 14:02:30 CST 2023
> Last Access UNKNOWN
> Created By Spark 4.0.0-SNAPSHOT
> Type MANAGED
> Provider hive
> Table Properties [transient_lastDdlTime=1691388473]
> Statistics 30 bytes
> Location
> [file:/Users/zhuqi/spark/spark/spark-warehouse/tbl|file:///Users/zhuqi/spark/spark/spark-warehouse/tbl]
> Serde Library org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
> InputFormat org.apache.hadoop.mapred.TextInputFormat
> OutputFormat
> org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
> Storage Properties [serialization.format=1]
> Partition Provider Catalog
> Time taken: 0.032 seconds, Fetched 23 row(s)
> create table tbl2 like tbl;
> 23/08/07 14:14:07 WARN HiveMetaStore: Location:
> [file:/Users/zhuqi/spark/spark/spark-warehouse/tbl2|file:///Users/zhuqi/spark/spark/spark-warehouse/tbl2]
> specified for non-external table:tbl2
> Time taken: 0.098 seconds
> spark-sql (default)> describe table extended tbl2;
> col0 int
> col1 int
> col2 int
> col3 int
> Detailed Table Information
> Catalog spark_catalog
> Database default
> Table tbl2
> Owner zhuqi
> Created Time Mon Aug 07 14:14:07 CST 2023
> Last Access UNKNOWN
> Created By Spark 4.0.0-SNAPSHOT
> Type MANAGED
> Provider hive
> Table Properties [transient_lastDdlTime=1691388847]
> Location
> [file:/Users/zhuqi/spark/spark/spark-warehouse/tbl2|file:///Users/zhuqi/spark/spark/spark-warehouse/tbl2]
> Serde Library org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
> InputFormat org.apache.hadoop.mapred.TextInputFormat
> OutputFormat
> org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
> Storage Properties [serialization.format=1]
> Partition Provider Catalog
> Time taken: 0.03 seconds, Fetched 22 row(s)
> The table stats are missing.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]