Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

allow datafusion cli to take -- comments #296

Merged
merged 2 commits into from
May 9, 2021
Merged
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
10 changes: 8 additions & 2 deletions datafusion-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ async fn exec_from_lines(

for line in reader.lines() {
match line {
Ok(line) if line.starts_with("--") => {
continue;
}
Ok(line) => {
let line = line.trim_end();
query.push_str(line);
Expand All @@ -124,7 +127,7 @@ async fn exec_from_lines(
}
query = "".to_owned();
} else {
query.push(' ');
query.push('\n');
}
}
_ => {
Expand Down Expand Up @@ -154,6 +157,9 @@ async fn exec_from_repl(execution_config: ExecutionConfig, print_format: PrintFo
Ok(ref line) if is_exit_command(line) && query.is_empty() => {
break;
}
Ok(ref line) if line.starts_with("--") => {
continue;
}
Ok(ref line) if line.trim_end().ends_with(';') => {
query.push_str(line.trim_end());
rl.add_history_entry(query.clone());
Expand All @@ -165,7 +171,7 @@ async fn exec_from_repl(execution_config: ExecutionConfig, print_format: PrintFo
}
Ok(ref line) => {
query.push_str(line);
query.push(' ');
query.push('\n');
}
Err(_) => {
break;
Expand Down