aokolnychyi commented on code in PR #47943:
URL: https://github.com/apache/spark/pull/47943#discussion_r1739489725


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala:
##########
@@ -92,7 +93,38 @@ class QueryExecution(
       sparkSession.sessionState.analyzer.executeAndCheck(logical, tracker)
     }
     tracker.setAnalyzed(plan)
-    plan
+
+    mode match {

Review Comment:
   This part will have to evolve. There are 3 options for us to consider.
   
   1. Add a special type of commands that must be executed during the analysis 
(i.e. generalize and polish this PR).
   2. Add a special mix-in interface for procedures that know the type of the 
last result set before the execution. All other procedures will not output 
anything if invoked via `spark.sql`.
   3. Migrate to `qe.commandExecuted` instead of `qe.analyzed` everywhere as we 
will know the output only after executing the procedure.
   
   



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala:
##########
@@ -92,7 +93,38 @@ class QueryExecution(
       sparkSession.sessionState.analyzer.executeAndCheck(logical, tracker)
     }
     tracker.setAnalyzed(plan)
-    plan
+
+    mode match {

Review Comment:
   This part will have to evolve. There are 3 options for us to consider.
   
   1. Add a special type of commands that must be executed during the analysis 
(i.e. generalize this PR).
   2. Add a special mix-in interface for procedures that know the type of the 
last result set before the execution. All other procedures will not output 
anything if invoked via `spark.sql`.
   3. Migrate to `qe.commandExecuted` instead of `qe.analyzed` everywhere as we 
will know the output only after executing the procedure.
   
   



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