liamzwbao commented on code in PR #16502:
URL: https://github.com/apache/datafusion/pull/16502#discussion_r2167939780


##########
datafusion-cli/src/exec.rs:
##########
@@ -231,10 +231,24 @@ pub(super) async fn exec_and_print(
         let adjusted =
             
AdjustedPrintOptions::new(print_options.clone()).with_statement(&statement);
 
-        let plan = create_plan(ctx, statement).await?;
+        // Only clone the statement if it's a CreateExternalTable

Review Comment:
   Sure, I also feel like putting the logic here hurts the readability. 
   
   I searched in the code and looks like it's probably ok to always clone the 
statement here, so I simplify the logic in the `exec_and_print` to make it a 
bit clearer.
   
   I can revert to the previous version if you think that one is better.
   
   Also created an issue #16559 to encapsulate the logic in a followup PR



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