rdblue commented on a change in pull request #26817: [SPARK-30192][SQL] support 
column position in DS v2
URL: https://github.com/apache/spark/pull/26817#discussion_r356903539
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
 ##########
 @@ -2803,19 +2804,23 @@ class AstBuilder(conf: SQLConf) extends 
SqlBaseBaseVisitor[AnyRef] with Logging
       Option(ctx.partitionSpec).map(visitNonOptionalPartitionSpec))
   }
 
+  override def visitColPosition(ctx: ColPositionContext): ColumnPosition = {
+    ctx.position.getType match {
+      case SqlBaseParser.FIRST => ColumnPosition.FIRST
+      case SqlBaseParser.AFTER => 
ColumnPosition.createAfter(ctx.afterCol.getText)
 
 Review comment:
   Sorry, I think this is right after all. The parser uses a single identifier, 
so the syntax is actually `ADD COLUMN point.z AFTER y` not `ADD COLUMN point.z 
AFTER point.y`.
   
   I think I'd prefer updating it to parse a multi-part identifier and accept 
both `point.y` and `y`, but that can be done as a follow-up.

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