Gengliang Wang created SPARK-24675: -------------------------------------- Summary: 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
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: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org