Skip to content

Commit

Permalink
Bump datafusion to 36.0.0 and make ballista compatible with it. (#1027)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelMarinier committed Jun 21, 2024
1 parent 1b0235e commit 3b6964b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ arrow-flight = { version = "50.0.0", features = ["flight-sql-experimental"] }
arrow-schema = { version = "50.0.0", default-features = false }
configure_me = { version = "0.4.0" }
configure_me_codegen = { version = "0.4.4" }
datafusion = "35.0.0"
datafusion-cli = "35.0.0"
datafusion-proto = "35.0.0"
datafusion = "36.0.0"
datafusion-cli = "36.0.0"
datafusion-proto = "36.0.0"
object_store = "0.9.0"
sqlparser = "0.41.0"
sqlparser = "0.43.0"
tonic = { version = "0.10" }
tonic-build = { version = "0.10", default-features = false, features = [
"transport",
Expand Down
3 changes: 3 additions & 0 deletions ballista-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ OPTIONS:
-c, --batch-size <BATCH_SIZE>
The batch size of each query, or use Ballista default
--color
Enables console syntax highlighting
--concurrent-tasks <CONCURRENT_TASKS>
The max concurrent tasks, only for Ballista local mode. Default: all available cores
Expand Down
10 changes: 9 additions & 1 deletion ballista-cli/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,15 @@ pub async fn exec_from_files(
/// run and execute SQL statements and commands against a context with the given print options
pub async fn exec_from_repl(ctx: &BallistaContext, print_options: &mut PrintOptions) {
let mut rl = Editor::new().expect("created editor");
rl.set_helper(Some(CliHelper::default()));
rl.set_helper(Some(CliHelper::new(
&ctx.context()
.task_ctx()
.session_config()
.options()
.sql_parser
.dialect,
print_options.color,
)));
rl.load_history(".history").ok();

let mut print_options = print_options.clone();
Expand Down
4 changes: 4 additions & 0 deletions ballista-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ struct Args {
help = "Reduce printing other than the results and work quietly"
)]
quiet: bool,

#[clap(long, help = "Enables console syntax highlighting")]
color: bool,
}

#[tokio::main]
Expand Down Expand Up @@ -135,6 +138,7 @@ pub async fn main() -> Result<()> {
format: args.format,
quiet: args.quiet,
maxrows: MaxRows::Unlimited,
color: args.color,
};

let files = args.file;
Expand Down
4 changes: 4 additions & 0 deletions ballista/client/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ impl BallistaContext {
Ok(is_show_variable)
}

pub fn context(&self) -> &SessionContext {
&self.context
}

/// Create a DataFrame from a SQL statement.
///
/// This method is `async` because queries of type `CREATE EXTERNAL TABLE`
Expand Down

0 comments on commit 3b6964b

Please sign in to comment.