alamb commented on code in PR #16604:
URL: https://github.com/apache/datafusion/pull/16604#discussion_r2173310059


##########
datafusion/core/src/dataframe/mod.rs:
##########
@@ -1615,11 +1617,27 @@ impl DataFrame {
     /// # }
     /// ```
     pub fn explain(self, verbose: bool, analyze: bool) -> Result<DataFrame> {
+        // Keep the API not changed, the default for this API will use 
ExplainFormat::Indent
+        self.explain_option_format(verbose, analyze, ExplainFormat::Indent)
+    }
+
+    /// Return a DataFrame with the explanation of its plan so far.
+    ///
+    /// if `analyze` is specified, runs the plan and reports metrics
+    /// if `verbose` is true, prints out additional details.
+    /// The `explain_format` parameter allows to specify the format of the 
explanation,
+    /// Details format info: see [`ExplainFormat`].
+    pub fn explain_option_format(

Review Comment:
   If we are going to add a new function, what do you think about making a new 
struct (to make adding new options easier in the future)
   
   Something like
   ```rust
   struct ExplainOptions {
     verbose: bool,
     analyze: bool,
     explain_format: ExplainFormat,
   }
   
   pub fn explain_with_options(
    self,
    options: ExplainOptions
   )
   ```
   
   ?
   



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to