gengliangwang commented on code in PR #41395:
URL: https://github.com/apache/spark/pull/41395#discussion_r1213874614
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:
##########
@@ -488,6 +488,8 @@ class SparkSqlAstBuilder extends AstBuilder {
} else {
LocalTempView
}
+ val qPlan: LogicalPlan = plan(ctx.query)
+ qPlan.setTagValue(LogicalPlan.NO_PARAM_ALLOWED_TAG, "CREATE VIEW body")
Review Comment:
since TreeNodeTag is not reliable. Shall we check whether `qPlan` contains
parameter here?
```
checkInvalidParameter(qPlan)
qPlan.innerChildren.foreach {
case p: LogicalPlan => checkInvalidParameter(p)
case _ =>
}
```
The method checkInvalidParameter is defined as
```
private def checkInvalidParameter(plan: LogicalPlan): Unit = {
plan.foreach { p =>
if (p.expressions.exists(_.containsPattern(PARAMETER))) {
p.failAnalysis(
errorClass =
"UNSUPPORTED_FEATURE.PARAMETER_MARKER_IN_UNEXPECTED_STATEMENT",
messageParameters = Map("statement" -> "CREATE VIEW body"))
}
}
}
```
--
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]