This is an automated email from the ASF dual-hosted git repository.

agrove pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-ballista.git


The following commit(s) were added to refs/heads/main by this push:
     new 3b6964bd Bump datafusion to 36.0.0 and make ballista compatible with 
it. (#1027)
3b6964bd is described below

commit 3b6964bd973d399619a33336d9cf618173985eb0
Author: RaphaĆ«l Marinier <[email protected]>
AuthorDate: Fri Jun 21 19:42:45 2024 +0200

    Bump datafusion to 36.0.0 and make ballista compatible with it. (#1027)
---
 Cargo.toml                     |  8 ++++----
 ballista-cli/README.md         |  3 +++
 ballista-cli/src/exec.rs       | 10 +++++++++-
 ballista-cli/src/main.rs       |  4 ++++
 ballista/client/src/context.rs |  4 ++++
 5 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index e40faf52..13984c0e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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",
diff --git a/ballista-cli/README.md b/ballista-cli/README.md
index 38808357..893e09a6 100644
--- a/ballista-cli/README.md
+++ b/ballista-cli/README.md
@@ -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
 
diff --git a/ballista-cli/src/exec.rs b/ballista-cli/src/exec.rs
index 9101ca0b..5c602183 100644
--- a/ballista-cli/src/exec.rs
+++ b/ballista-cli/src/exec.rs
@@ -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();
diff --git a/ballista-cli/src/main.rs b/ballista-cli/src/main.rs
index 67750429..a8055c87 100644
--- a/ballista-cli/src/main.rs
+++ b/ballista-cli/src/main.rs
@@ -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]
@@ -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;
diff --git a/ballista/client/src/context.rs b/ballista/client/src/context.rs
index de31df0f..5ed77cd4 100644
--- a/ballista/client/src/context.rs
+++ b/ballista/client/src/context.rs
@@ -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`


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to