[
https://issues.apache.org/jira/browse/SPARK-16678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15388887#comment-15388887
]
Apache Spark commented on SPARK-16678:
--------------------------------------
User 'gatorsmile' has created a pull request for this issue:
https://github.com/apache/spark/pull/14314
> Disallow Creating a View when the same-name Table Exists
> --------------------------------------------------------
>
> Key: SPARK-16678
> URL: https://issues.apache.org/jira/browse/SPARK-16678
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.0.0
> Reporter: Xiao Li
>
> When we create a view, we check whether the view already exists. In the
> current implementation, if a table with the same name exists, we treat it as
> a view. However, this is not the right behavior. We should follow what Hive
> does. For example,
> {noformat}
> hive> CREATE TABLE tab1 (id int);
> OK
> Time taken: 0.196 seconds
> hive> CREATE OR REPLACE VIEW tab1 AS SELECT * FROM t1;
> FAILED: SemanticException [Error 10218]: Existing table is not a view
> The following is an existing table, not a view: default.tab1
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]