petern48 commented on code in PR #17481:
URL: https://github.com/apache/datafusion/pull/17481#discussion_r2337477756


##########
datafusion/sql/src/statement.rs:
##########
@@ -1714,7 +1714,12 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
             let options = self.context_provider.options();
             let format = format.as_ref().unwrap_or(&options.explain.format);
 
-            let format: ExplainFormat = format.parse()?;
+            // verbose mode only supports indent format
+            let format: ExplainFormat = if verbose {
+                ExplainFormat::Indent
+            } else {
+                format.parse()?

Review Comment:
   1. If both verbose and format are given, we actually return an error. The 
code below is a few lines above. I think this still makes sense since verbose 
only supports one format.
   
   ```rust
           if verbose && format.is_some() {
               return plan_err!("EXPLAIN VERBOSE with FORMAT is not supported");
           }
   ```
   
   2. We already raise an error if the format is not supported (the logic is in 
a different file).
   
   ```sql> explain format treee select 1;
   Error during planning: Invalid explain format. Expected 'indent', 'tree', 
'pgjson' or 'graphviz'. Got 'treee'
   ```



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