You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Ales Cervenka (JIRA)" <ji...@apache.org> on 2016/07/15 14:33:20 UTC

[jira] [Created] (SPARK-16570) Not able to access table's data after ALTER TABLE RENAME in Spark 1.6.2

Ales Cervenka created SPARK-16570:
-------------------------------------

             Summary: 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.2, 1.6.1
         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