Skip to content

Commit

Permalink
refactor: standardize exec_from funcs arg order (apache#8809)
Browse files Browse the repository at this point in the history
  • Loading branch information
tshauck authored Jan 10, 2024
1 parent 78d3314 commit e862539
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions datafusion-cli/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions datafusion-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(())
Expand Down

0 comments on commit e862539

Please sign in to comment.