cloud-fan commented on a change in pull request #26303: [SPARK-29643][SQL] 
ALTER TABLE (DROP PARTITION) should look up catalog/table like v2 commands
URL: https://github.com/apache/spark/pull/26303#discussion_r340941958
 
 

 ##########
 File path: 
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
 ##########
 @@ -164,7 +164,7 @@ statement
         partitionSpec+                                                 
#addTablePartition
     | ALTER TABLE tableIdentifier
         from=partitionSpec RENAME TO to=partitionSpec                  
#renameTablePartition
-    | ALTER TABLE tableIdentifier
+    | ALTER TABLE  multipartIdentifier
         DROP (IF EXISTS)? partitionSpec (',' partitionSpec)* PURGE?    
#dropTablePartitions
     | ALTER VIEW tableIdentifier
         DROP (IF EXISTS)? partitionSpec (',' partitionSpec)*           
#dropTablePartitions
 
 Review comment:
   Sorry I missed it. These 2 parser rules share the same label, so they are 
essentially one rule.
   I agree with @imback82 that it's better to merge them:
   ```
   ALTER TABLE | VIEW multipartIdentifier
     DROP (IF EXISTS)? partitionSpec (',' partitionSpec)* PURGE?
   ```

----------------------------------------------------------------
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