Skip to content

refactor: standardize exec_from funcs arg order #8809

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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