andygrove commented on code in PR #7681:
URL: https://github.com/apache/datafusion-comet/pull/7681#discussion_r4622462255


##########
spark/src/main/scala/org/apache/comet/ExtendedExplainInfo.scala:
##########
@@ -64,6 +64,28 @@ class ExtendedExplainInfo extends ExtendedExplainGenerator {
     fallbackReasons(plan).toSeq.sorted
   }
 
+  /**
+   * The fallback reasons in the executed plan of `df`, as returned by 
`getFallbackReasons(plan)`.
+   * This does not run the query. For an adaptive query that has not run yet, 
the executed plan is
+   * the initial plan, so run the query first (for example with `collect()`) 
to get the reasons
+   * for the final plan and its query stages.
+   */
+  def getFallbackReasons(df: DataFrame): Seq[String] = {
+    getFallbackReasons(df.queryExecution.executedPlan)
+  }
+
+  /**
+   * Whether Comet is enabled for the session of `df` and reports no fallback 
reasons for its
+   * executed plan. Enabled means the check the Comet planner rules make, so 
this is false when
+   * Comet disabled itself, for example because Spark is not in off-heap mode 
or the Comet shuffle
+   * manager is not set, even if `spark.comet.enabled` is true. Like 
`getFallbackReasons(df)`,
+   * this does not run the query.
+   */
+  def planAccelerated(df: DataFrame): Boolean = {

Review Comment:
   nit: the name is misleading, IMO. A plan can still be accelerated and have 
partial fallback. Maybe this should be `planFullyAccelerated` or `noFallbacks` 
or something?



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