miland-db commented on code in PR #47609:
URL: https://github.com/apache/spark/pull/47609#discussion_r1722040359


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -651,13 +652,31 @@ class SparkSession private(
     withActive {
       val plan = tracker.measurePhase(QueryPlanningTracker.PARSING) {
         val parsedPlan = sessionState.sqlParser.parsePlan(sqlText)
-        if (args.nonEmpty) {
-          PosParameterizedQuery(parsedPlan, 
args.map(lit(_).expr).toImmutableArraySeq)
-        } else {
-          parsedPlan
+        parsedPlan match {
+          case compoundBody: CompoundBody => compoundBody
+          case logicalPlan: LogicalPlan if args.nonEmpty =>
+            PosParameterizedQuery(logicalPlan, 
args.map(lit(_).expr).toImmutableArraySeq)
+          case p =>
+            assert(args.isEmpty, "Named parameters are not supported for batch 
queries")

Review Comment:
   Done.



-- 
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]

Reply via email to