xianyinxin commented on a change in pull request #25626: [SPARK-28892][SQL] Add
UPDATE support for DataSource V2
URL: https://github.com/apache/spark/pull/25626#discussion_r320711408
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -352,6 +352,36 @@ class AstBuilder(conf: SQLConf) extends
SqlBaseBaseVisitor[AnyRef] with Logging
DeleteFromStatement(tableId, tableAlias,
expression(ctx.whereClause().booleanExpression()))
}
+ override def visitUpdateTable(ctx: UpdateTableContext): LogicalPlan =
withOrigin(ctx) {
+ val tableId = visitMultipartIdentifier(ctx.multipartIdentifier)
+ val tableAlias = if (ctx.tableAlias() != null) {
+ val ident = ctx.tableAlias().strictIdentifier()
+ // We do not allow columns aliases after table alias.
+ if (ctx.tableAlias().identifierList() != null) {
+ throw new ParseException("Columns aliases is not allowed in UPDATE.",
+ ctx.tableAlias().identifierList())
+ }
+ if (ident != null) { Some(ident.getText) } else { None }
Review comment:
Done.
----------------------------------------------------------------
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]