cloud-fan commented on code in PR #47609:
URL: https://github.com/apache/spark/pull/47609#discussion_r1719952208
##########
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
Review Comment:
OK I see it, but the code isn't very readable. I'd prefer more explicit way
```
case compoundBody: CompoundBody =>
if has args fails
execute script
case p =>
if has args PosParameterizedQuery... else ...
```
--
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]