[
https://issues.apache.org/jira/browse/SPARK-24675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xiao Li resolved SPARK-24675.
-----------------------------
Resolution: Fixed
Assignee: Gengliang Wang
Fix Version/s: 2.4.0
> Rename table: validate existence of new location
> ------------------------------------------------
>
> Key: SPARK-24675
> URL: https://issues.apache.org/jira/browse/SPARK-24675
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 2.3.1
> Reporter: Gengliang Wang
> Assignee: Gengliang Wang
> Priority: Major
> Fix For: 2.4.0
>
>
> If table is renamed to a existing new location, data won't show up.
>
> scala> Seq("hello").toDF("a").write.format("parquet").saveAsTable("t")
> scala> sql("select * from t").show()
> +-----+
> | a|
> +-----+
> |hello|
> +-----+
> scala> sql("alter table t rename to test")
> res2: org.apache.spark.sql.DataFrame = []
> scala> sql("select * from test").show()
> +---+
> | a|
> +---+
> +—+
>
> In Hive, if the new location exists, the renaming will fail even the location
> is empty.
> We should have the same validation in catalog, in case of unexpected bugs.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]