wengh commented on code in PR #50408: URL: https://github.com/apache/spark/pull/50408#discussion_r2022160221
########## sql/api/src/main/scala/org/apache/spark/sql/catalyst/parser/DataTypeAstBuilder.scala: ########## @@ -45,6 +45,78 @@ class DataTypeAstBuilder extends SqlBaseParserBaseVisitor[AnyRef] { withOrigin(ctx)(StructType(visitColTypeList(ctx.colTypeList))) } + override def visitSingleRoutineParamList(ctx: SingleRoutineParamListContext): StructType = { + withOrigin(ctx)(StructType(visitSimplifiedColDefinitionList(ctx.colDefinitionList()))) + } + + private def visitSimplifiedColDefinitionList( + ctx: ColDefinitionListContext): Seq[StructField] = withOrigin(ctx) { + ctx.colDefinition().asScala.map(visitStructField).toSeq + } + + /** + * Create a [[StructField]] from a column definition which allows options like COMMENT and + * DEFAULT. + * + * Don't handle generation expression since this function is currently only used for creating Review Comment: we reject it in SparkSqlParser so that the error ParserRuleContext is the same as in DBR (CreateUserDefinedFunctionContext.parameters) -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org