wangyinsheng commented on code in PR #12581:
URL: https://github.com/apache/hudi/pull/12581#discussion_r1908168656
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/parser/HoodieSqlCommonAstBuilder.scala:
##########
@@ -92,16 +93,24 @@ class HoodieSqlCommonAstBuilder(session: SparkSession,
delegate: ParserInterface
}
override def visitCall(ctx: CallContext): LogicalPlan = withOrigin(ctx) {
- if (ctx.callArgumentList() == null ||
ctx.callArgumentList().callArgument() == null ||
ctx.callArgumentList().callArgument().size() == 0) {
- val name: Seq[String] =
ctx.multipartIdentifier().parts.asScala.map(_.getText).toSeq
- CallCommand(name, Seq())
+ val name: Seq[String] =
ctx.multipartIdentifier().parts.asScala.map(_.getText).toSeq
+ val args: Seq[CallArgument] = if (ctx.callArgumentList() == null ||
ctx.callArgumentList().callArgument() == null ||
ctx.callArgumentList().callArgument().size() == 0) {
+ Seq()
} else {
- val name: Seq[String] =
ctx.multipartIdentifier().parts.asScala.map(_.getText).toSeq
- val args: Seq[CallArgument] =
ctx.callArgumentList().callArgument().asScala.map(typedVisit[CallArgument]).toSeq
+
ctx.callArgumentList().callArgument().asScala.map(typedVisit[CallArgument]).toSeq
+ }
+ if (isHudiCallCommand(name)) {
CallCommand(name, args)
+ } else {
+ null
}
}
+ def isHudiCallCommand(name: Seq[String]): Boolean = {
+ val builder = HoodieProcedures.newBuilder(name.last)
Review Comment:
Add check for empty name
--
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]