You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (JIRA)" <ji...@apache.org> on 2016/07/15 17:14:20 UTC
[jira] [Commented] (SPARK-16570) Not able to access table's data
after ALTER TABLE RENAME in Spark 1.6.2
[ https://issues.apache.org/jira/browse/SPARK-16570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15379706#comment-15379706 ]
Dongjoon Hyun commented on SPARK-16570:
---------------------------------------
Hi, [~alez.cervenka].
FYI, the current master works like that. It seems it's fixed.
```
scala> sql("SELECT * FROM mytesttable").show()
+----+----+
|col1|col2|
+----+----+
| 1| 2|
+----+----+
scala> sql("ALTER TABLE mytesttable RENAME TO mytesttable_withnewname")
res2: org.apache.spark.sql.DataFrame = []
scala> sql("SELECT * FROM mytesttable_withnewname").show()
+----+----+
|col1|col2|
+----+----+
| 1| 2|
+----+----+
```
> Not able to access table's data after ALTER TABLE RENAME in Spark 1.6.2
> -----------------------------------------------------------------------
>
> Key: SPARK-16570
> URL: https://issues.apache.org/jira/browse/SPARK-16570
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 1.6.1, 1.6.2
> Environment: Ubuntu 14.04, hadoop 2.7.1
> Reporter: Ales Cervenka
> Fix For: 1.6.2
>
>
> Spark 1.6.1 and 1.6.2 is not able to read data from a table after the table has been renamed. This can be reproduced with the following actions in the spark-shell:
> sqlContext.sql("SELECT 1 as col1, 2 as col2").write.format("parquet").mode("overwrite").saveAsTable("mytesttable")
> sqlContext.sql("SELECT * FROM mytesttable").show()
> +----+----+
> |col1|col2|
> +----+----+
> | 1| 2|
> +----+----+
> sqlContext.sql("ALTER TABLE mytesttable RENAME TO mytesttable_withnewname")
> sqlContext.sql("SELECT * FROM mytesttable_withnewname").show()
> +----+----+
> |col1|col2|
> +----+----+
> +----+----+
> I believe the issue is related to SPARK-14920 and SPARK-15635 - Spark stores (and later retrieves) a location of a table to a "path" SerDe property, which is not modified in HiveMetaStore's alter_table. And as the actual directory on HDFS is renamed, the "path" doesn't point to a correct location after the update.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org