anew commented on code in PR #56419:
URL: https://github.com/apache/spark/pull/56419#discussion_r3399428217
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:
##########
@@ -1516,6 +1516,98 @@ class SparkSqlAstBuilder extends AstBuilder {
)
}
+ override def visitCreateFlowAutoCdc(
+ ctx: CreateFlowAutoCdcContext): LogicalPlan = withOrigin(ctx) {
+ val flowHeaderCtx = ctx.createPipelineFlowHeader()
+ val ident = withIdentClause(flowHeaderCtx.flowName,
UnresolvedIdentifier(_))
+ val commentOpt = Option(flowHeaderCtx.commentSpec()).map(visitCommentSpec)
+ val applyChanges = buildAutoCdcIntoCommand(ctx.autoCdcCommand())
+ CreateFlowCommand(
+ name = ident,
+ flowOperation = applyChanges,
+ comment = commentOpt
+ )
+ }
+
+ override def visitCreateStreamingTableAutoCdc(
+ ctx: CreateStreamingTableAutoCdcContext): LogicalPlan = withOrigin(ctx) {
+ val headerCtx = ctx.createPipelineDatasetHeader()
+
+ if (headerCtx.materializedView() != null) {
+ throw operationNotAllowed(
+ "AUTO CDC is only supported for STREAMING TABLE, not MATERIALIZED
VIEW.", ctx)
+ }
+
+ val ifNotExists = headerCtx.EXISTS() != null
+ val provider = Option(ctx.tableProvider).map(_.multipartIdentifier.getText)
+ val (colDefs, colConstraints) =
Option(ctx.tableElementList()).map(visitTableElementList)
Review Comment:
good point
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]