You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/05/22 21:48:11 UTC

[GitHub] [spark] yeshengm opened a new pull request #24681: [SPARK-27809] [SQL] Make optional clauses order insensitive for CREATE DATABASE/VIEW SQL statement

yeshengm opened a new pull request #24681: [SPARK-27809] [SQL] Make optional clauses order insensitive for CREATE DATABASE/VIEW SQL statement
URL: https://github.com/apache/spark/pull/24681
 
 
   ## What changes were proposed in this pull request?
   
   Each time, when I write a complex CREATE DATABASE/VIEW statements, I have to open the .g4 file to find the EXACT order of clauses in CREATE TABLE statement. When the order is not right, I will get A strange confusing error message generated from ANTLR4.
   
   The original g4 grammar for CREATE VIEW is
   ```
   CREATE [OR REPLACE] [[GLOBAL] TEMPORARY] VIEW [db_name.]view_name
     [(col_name1 [COMMENT col_comment1], ...)]
     [COMMENT table_comment]
     [TBLPROPERTIES (key1=val1, key2=val2, ...)]
   AS select_statement
   ```
   The proposal is to make the following clauses order insensitive.
   ```
     [COMMENT table_comment]
     [TBLPROPERTIES (key1=val1, key2=val2, ...)]
   ```
   –
   The original g4 grammar for CREATE DATABASE is
   ```
   CREATE (DATABASE|SCHEMA) [IF NOT EXISTS] db_name
     [COMMENT comment_text]
     [LOCATION path]
     [WITH DBPROPERTIES (key1=val1, key2=val2, ...)]
   ```
   The proposal is to make the following clauses order insensitive.
   ```
     [COMMENT comment_text]
     [LOCATION path]
     [WITH DBPROPERTIES (key1=val1, key2=val2, ...)]
   ```
   ## How was this patch tested?
   
   By adding new unit tests to test duplicate clauses and modifying some existing unit tests to test whether those clauses are actually order insensitive

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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