cloud-fan commented on code in PR #52173: URL: https://github.com/apache/spark/pull/52173#discussion_r2340476248
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/parameters.scala: ########## @@ -203,6 +229,64 @@ object BindParameters extends Rule[LogicalPlan] with QueryErrorsBase { args(posToIndex(pos)) } + case GeneralParameterizedQuery(child, args, paramNames) + if !child.containsPattern(UNRESOLVED_WITH) && + args.forall(_.resolved) => + + // Check all arguments for validity (args are already evaluated expressions/literals) + val allArgs = args.zipWithIndex.map { case (arg, idx) => Review Comment: now the args and argNames are guaranteed to have the same length, so we can simplify it ``` val allArgs = if (paramNames.isEmpty) { args.zipWithIndex.map { case (arg, idx) => s"_$idx" -> arg } } else { args.zip(paramNames).map { case (arg, name) => name -> arg } } ``` -- 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