cloud-fan commented on a change in pull request #26338: [SPARK-29680][SQL] 
ALTER TABLE CHANGE COLUMN should look up catalog/table like v2 commands
URL: https://github.com/apache/spark/pull/26338#discussion_r341465698
 
 

 ##########
 File path: 
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
 ##########
 @@ -151,7 +151,7 @@ statement
     | ALTER TABLE multipartIdentifier
         (ALTER | CHANGE) COLUMN? qualifiedName
         (TYPE dataType)? (COMMENT comment=STRING)? colPosition?        
#alterTableColumn
-    | ALTER TABLE tableIdentifier partitionSpec?
+    | ALTER TABLE multipartIdentifier partitionSpec?
 
 Review comment:
   The v2 rule
   ```
   (ALTER | CHANGE) COLUMN? qualifiedName (TYPE dataType)? (COMMENT 
comment=STRING)?
   ```
   The `colType`
   ```
   colName=errorCapturingIdentifier dataType (COMMENT STRING)?
   ```
   
   Seems like the v1 rule is more powerful and can rename a column and change 
data type together. If other DBs support it as well, maybe Spark should also 
support it. Otherwise, maybe 3.0 is a good time to drop this syntax.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to