You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2018/06/28 07:48:00 UTC

[jira] [Commented] (SPARK-24675) Rename table: validate existence of new location

    [ https://issues.apache.org/jira/browse/SPARK-24675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16526048#comment-16526048 ] 

Apache Spark commented on SPARK-24675:
--------------------------------------

User 'gengliangwang' has created a pull request for this issue:
https://github.com/apache/spark/pull/21655

> 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
>            Priority: Major
>
> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org