This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new e862539199 refactor: standardize exec_from funcs arg order (#8809)
e862539199 is described below

commit e86253919983ffe89d74ec1310f5f080482adcff
Author: Trent Hauck <[email protected]>
AuthorDate: Wed Jan 10 11:22:23 2024 -0800

    refactor: standardize exec_from funcs arg order (#8809)
---
 datafusion-cli/src/exec.rs | 4 ++--
 datafusion-cli/src/main.rs | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/datafusion-cli/src/exec.rs b/datafusion-cli/src/exec.rs
index 2320a8c314..6598437830 100644
--- a/datafusion-cli/src/exec.rs
+++ b/datafusion-cli/src/exec.rs
@@ -51,8 +51,8 @@ use url::Url;
 /// run and execute SQL statements and commands, against a context with the 
given print options
 pub async fn exec_from_commands(
     ctx: &mut SessionContext,
-    print_options: &PrintOptions,
     commands: Vec<String>,
+    print_options: &PrintOptions,
 ) {
     for sql in commands {
         match exec_and_print(ctx, print_options, sql).await {
@@ -105,8 +105,8 @@ pub async fn exec_from_lines(
 }
 
 pub async fn exec_from_files(
-    files: Vec<String>,
     ctx: &mut SessionContext,
+    files: Vec<String>,
     print_options: &PrintOptions,
 ) {
     let files = files
diff --git a/datafusion-cli/src/main.rs b/datafusion-cli/src/main.rs
index 563d172f2c..dcfd28df1c 100644
--- a/datafusion-cli/src/main.rs
+++ b/datafusion-cli/src/main.rs
@@ -216,7 +216,7 @@ pub async fn main() -> Result<()> {
 
     if commands.is_empty() && files.is_empty() {
         if !rc.is_empty() {
-            exec::exec_from_files(rc, &mut ctx, &print_options).await
+            exec::exec_from_files(&mut ctx, rc, &print_options).await
         }
         // TODO maybe we can have thiserror for cli but for now let's keep it 
simple
         return exec::exec_from_repl(&mut ctx, &mut print_options)
@@ -225,11 +225,11 @@ pub async fn main() -> Result<()> {
     }
 
     if !files.is_empty() {
-        exec::exec_from_files(files, &mut ctx, &print_options).await;
+        exec::exec_from_files(&mut ctx, files, &print_options).await;
     }
 
     if !commands.is_empty() {
-        exec::exec_from_commands(&mut ctx, &print_options, commands).await;
+        exec::exec_from_commands(&mut ctx, commands, &print_options).await;
     }
 
     Ok(())

Reply via email to