From 4de878d33aa8cc845f24ccf914578dd974f7d629 Mon Sep 17 00:00:00 2001 From: Trent Hauck Date: Tue, 9 Jan 2024 18:54:22 -0800 Subject: [PATCH] refactor: standardize exec_from funcs arg order --- 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 2320a8c314cf..659843783016 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, + 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, ctx: &mut SessionContext, + files: Vec, print_options: &PrintOptions, ) { let files = files diff --git a/datafusion-cli/src/main.rs b/datafusion-cli/src/main.rs index 563d172f2c95..dcfd28df1cb0 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(())