[GitHub] [spark] imback82 commented on a change in pull request #29167: [SPARK-32374][SQL] Disallow setting properties when creating temporary views

2020-07-22 Thread GitBox


imback82 commented on a change in pull request #29167:
URL: https://github.com/apache/spark/pull/29167#discussion_r459212899



##
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala
##
@@ -266,6 +266,16 @@ abstract class SQLViewSuite extends QueryTest with 
SQLTestUtils {
 }
   }
 
+  test("SPARK-32374: disallow setting properties for CREATE TEMPORARY VIEW") {
+withTempView("myabcdview") {
+  val e = intercept[AnalysisException] {

Review comment:
   Oh because `ParseException` extends `AnalysisException`. I will update 
this.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[GitHub] [spark] imback82 commented on a change in pull request #29167: [SPARK-32374][SQL] Disallow setting properties when creating temporary views

2020-07-20 Thread GitBox


imback82 commented on a change in pull request #29167:
URL: https://github.com/apache/spark/pull/29167#discussion_r457692814



##
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala
##
@@ -2003,6 +2002,17 @@ class DDLParserSuite extends AnalysisTest {
 intercept(sql2, "Found duplicate clauses: TBLPROPERTIES")
   }
 
+  test("create temporary view with properties not allowed") {

Review comment:
   updated. thanks!





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[GitHub] [spark] imback82 commented on a change in pull request #29167: [SPARK-32374][SQL] Disallow setting properties when creating temporary views

2020-07-20 Thread GitBox


imback82 commented on a change in pull request #29167:
URL: https://github.com/apache/spark/pull/29167#discussion_r457632275



##
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##
@@ -3515,6 +3515,13 @@ class AstBuilder(conf: SQLConf) extends 
SqlBaseBaseVisitor[AnyRef] with Logging
   }
 }
 
+val properties = 
ctx.tablePropertyList.asScala.headOption.map(visitPropertyKeyValues)
+  .getOrElse(Map.empty)
+if (ctx.TEMPORARY != null && !properties.isEmpty) {
+  operationNotAllowed(
+"CREATE TEMPORARY VIEW ... TBLPROPERTIES (property_name = 
property_value, ...)", ctx)

Review comment:
   This can be moved to `CreateViewCommand` if that is a better place to 
check this: 
https://github.com/apache/spark/blob/fe07521c9efd9ce0913eee0d42b0ffd98b1225ec/sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala#L80-L85





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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