cloud-fan commented on a change in pull request #32442:
URL: https://github.com/apache/spark/pull/32442#discussion_r628032240
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -193,13 +193,32 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef] with
SQLConfHelper with Logg
* This is only used for Common Table Expressions.
*/
override def visitNamedQuery(ctx: NamedQueryContext): SubqueryAlias =
withOrigin(ctx) {
- val subQuery: LogicalPlan = plan(ctx.query).optionalMap(ctx.columnAliases)(
+ val logicalPlan = Option(ctx.query).map(plan).orElse(
+ Option(ctx.ddlStatementForQuery).map(visitDdlStatementForQuery)).get
Review comment:
nit: we can call `visitDdlQuery` and don't need to create
`visitDdlStatementForQuery`
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]