peterpashkin commented on code in PR #50605:
URL: https://github.com/apache/spark/pull/50605#discussion_r2068867176


##########
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectAnalyzeHandler.scala:
##########
@@ -61,21 +64,24 @@ private[connect] class SparkConnectAnalyzeHandler(
 
     def transformRelation(rel: proto.Relation) = 
planner.transformRelation(rel, cachePlan = true)
 
+    def getDataFrameWithoutExecuting(rel: LogicalPlan): DataFrame = {
+      val qe = session.sessionState.executePlan(rel, CommandExecutionMode.SKIP)
+      if (!qe.isLazyAnalysis) qe.assertAnalyzed()
+      new Dataset[Row](qe, () => RowEncoder.encoderFor(qe.analyzed.schema))

Review Comment:
   I was referring more to the fact that the Dataset was also constructed 
before my change, so I am not introducing any more computation. Changing this 
to only return a QueryExecution will just benefit SCHEMA, TREE_STRING and 
EXPLAIN while making the code harder to read. I feel like this tradeoff is not 
really beneficial here



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

Reply via email to