[jira] [Commented] (SPARK-16937) Confusing behaviors when View and Temp View sharing the same names

2016-08-07 Thread Xiao Li (JIRA)

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

Xiao Li commented on SPARK-16937:
-

Sure, will do it. Thanks!

> Confusing behaviors when View and Temp View sharing the same names
> --
>
> Key: SPARK-16937
> URL: https://issues.apache.org/jira/browse/SPARK-16937
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.0.0
>Reporter: Xiao Li
>
> {noformat}
> sql(s"CREATE TEMPORARY VIEW $viewName AS SELECT * FROM $tabName WHERE 
> ID < 3")
> sql(s"CREATE VIEW $viewName AS SELECT * FROM $tabName")
> // This returns the contents of the temp view.
> sql(s"select * from $viewName").show(false)
> // This returns the contents of the view.
> sql(s"select * from default.$viewName").show(false)
> // Below is to drop the temp view
> sql(s"DROP VIEW $viewName")
> // Both results are non-temp view
> sql(s"select * from $viewName").show(false)
> sql(s"select * from default.$viewName").show(false)
> // After another drop, the non-temp view is dropped.
> sql(s"DROP VIEW $viewName")
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-16937) Confusing behaviors when View and Temp View sharing the same names

2016-08-07 Thread Wenchen Fan (JIRA)

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

Wenchen Fan commented on SPARK-16937:
-

For the problem described in the JIRA, yea, seems our rule is not so friendly, 
but we need to be very careful when changing rules.
For the ALTER VIEW, SGTM, can you open a new JIRA?

> Confusing behaviors when View and Temp View sharing the same names
> --
>
> Key: SPARK-16937
> URL: https://issues.apache.org/jira/browse/SPARK-16937
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.0.0
>Reporter: Xiao Li
>
> {noformat}
> sql(s"CREATE TEMPORARY VIEW $viewName AS SELECT * FROM $tabName WHERE 
> ID < 3")
> sql(s"CREATE VIEW $viewName AS SELECT * FROM $tabName")
> // This returns the contents of the temp view.
> sql(s"select * from $viewName").show(false)
> // This returns the contents of the view.
> sql(s"select * from default.$viewName").show(false)
> // Below is to drop the temp view
> sql(s"DROP VIEW $viewName")
> // Both results are non-temp view
> sql(s"select * from $viewName").show(false)
> sql(s"select * from default.$viewName").show(false)
> // After another drop, the non-temp view is dropped.
> sql(s"DROP VIEW $viewName")
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-16937) Confusing behaviors when View and Temp View sharing the same names

2016-08-07 Thread Xiao Li (JIRA)

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

Xiao Li commented on SPARK-16937:
-

We are using different name resolution rules, should we make them consistent?

> Confusing behaviors when View and Temp View sharing the same names
> --
>
> Key: SPARK-16937
> URL: https://issues.apache.org/jira/browse/SPARK-16937
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.0.0
>Reporter: Xiao Li
>
> {noformat}
> sql(s"CREATE TEMPORARY VIEW $viewName AS SELECT * FROM $tabName WHERE 
> ID < 3")
> sql(s"CREATE VIEW $viewName AS SELECT * FROM $tabName")
> // This returns the contents of the temp view.
> sql(s"select * from $viewName").show(false)
> // This returns the contents of the view.
> sql(s"select * from default.$viewName").show(false)
> // Below is to drop the temp view
> sql(s"DROP VIEW $viewName")
> // Both results are non-temp view
> sql(s"select * from $viewName").show(false)
> sql(s"select * from default.$viewName").show(false)
> // After another drop, the non-temp view is dropped.
> sql(s"DROP VIEW $viewName")
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-16937) Confusing behaviors when View and Temp View sharing the same names

2016-08-07 Thread Xiao Li (JIRA)

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

Xiao Li commented on SPARK-16937:
-

Currently, the existing DDL behaviors for views when users do not specify the 
database name are described below:

{{CREATE OR REPLACE TEMPORARY VIEW view_name}} creates/alters the {{TEMPORARY}} 
view.

{{CREATE OR REPLACE VIEW view_name}} creates/alters the {{PERSISTENT}} view.

{{DROP VIEW view_name}} OR {{SELECT... FROM view_name}} is always first applied 
to a {{TEMPORARY}} view, if existing. If the temporary view does not exist, we 
try to drop/fetch the PERSISTENT view, if existing.

{{ALTER VIEW view_name}} is only applicable to the {{PERSISTENT}} view, even if 
the temporary view with the same name exists.

> Confusing behaviors when View and Temp View sharing the same names
> --
>
> Key: SPARK-16937
> URL: https://issues.apache.org/jira/browse/SPARK-16937
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.0.0
>Reporter: Xiao Li
>
> {noformat}
> sql(s"CREATE TEMPORARY VIEW $viewName AS SELECT * FROM $tabName WHERE 
> ID < 3")
> sql(s"CREATE VIEW $viewName AS SELECT * FROM $tabName")
> // This returns the contents of the temp view.
> sql(s"select * from $viewName").show(false)
> // This returns the contents of the view.
> sql(s"select * from default.$viewName").show(false)
> // Below is to drop the temp view
> sql(s"DROP VIEW $viewName")
> // Both results are non-temp view
> sql(s"select * from $viewName").show(false)
> sql(s"select * from default.$viewName").show(false)
> // After another drop, the non-temp view is dropped.
> sql(s"DROP VIEW $viewName")
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-16937) Confusing behaviors when View and Temp View sharing the same names

2016-08-07 Thread Xiao Li (JIRA)

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

Xiao Li commented on SPARK-16937:
-

[~rxin] [~yhuai] [~cloud_fan] Do you think the above behaviors are expected? 
IMO, the second statement should stop with an error. Is it a bug? Thanks!

> Confusing behaviors when View and Temp View sharing the same names
> --
>
> Key: SPARK-16937
> URL: https://issues.apache.org/jira/browse/SPARK-16937
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.0.0
>Reporter: Xiao Li
>
> {noformat}
> sql(s"CREATE TEMPORARY VIEW $viewName AS SELECT * FROM $tabName WHERE 
> ID < 3")
> sql(s"CREATE VIEW $viewName AS SELECT * FROM $tabName")
> // This returns the contents of the temp view.
> sql(s"select * from $viewName").show(false)
> // This returns the contents of the view.
> sql(s"select * from default.$viewName").show(false)
> // Below is to drop the temp view
> sql(s"DROP VIEW $viewName")
> // Both results are non-temp view
> sql(s"select * from $viewName").show(false)
> sql(s"select * from default.$viewName").show(false)
> // After another drop, the non-temp view is dropped.
> sql(s"DROP VIEW $viewName")
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org