From f9d925ec985024878ea8ec6a9d61a39e9a08a552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Milenkovi=C4=87?= Date: Sun, 24 Nov 2024 10:14:07 +0000 Subject: [PATCH] remove deprecated context creation --- ballista/core/src/utils.rs | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/ballista/core/src/utils.rs b/ballista/core/src/utils.rs index 396a66ad8..bf7533259 100644 --- a/ballista/core/src/utils.rs +++ b/ballista/core/src/utils.rs @@ -34,9 +34,7 @@ use datafusion::arrow::record_batch::RecordBatch; use datafusion::common::tree_node::{TreeNode, TreeNodeVisitor}; use datafusion::datasource::physical_plan::{CsvExec, ParquetExec}; use datafusion::error::DataFusionError; -use datafusion::execution::context::{ - QueryPlanner, SessionConfig, SessionContext, SessionState, -}; +use datafusion::execution::context::{QueryPlanner, SessionConfig, SessionState}; use datafusion::execution::runtime_env::{RuntimeConfig, RuntimeEnv}; use datafusion::execution::session_state::SessionStateBuilder; use datafusion::logical_expr::{DdlStatement, LogicalPlan, TableScan}; @@ -244,35 +242,6 @@ fn build_exec_plan_diagram( Ok(node_id) } -/// Create a client DataFusion context that uses the BallistaQueryPlanner to send logical plans -/// to a Ballista scheduler -pub fn create_df_ctx_with_ballista_query_planner( - scheduler_url: String, - session_id: String, - config: &BallistaConfig, -) -> SessionContext { - // TODO: put ballista configuration as part of sessions state - // planner can get it from there. - // This would make it changeable during run time - // using SQL SET statement - let planner: Arc> = - Arc::new(BallistaQueryPlanner::new(scheduler_url, config.clone())); - - let session_config = SessionConfig::new_with_ballista() - .with_information_schema(true) - .with_option_extension(config.clone()); - - let session_state = SessionStateBuilder::new() - .with_default_features() - .with_config(session_config) - .with_runtime_env(Arc::new(RuntimeEnv::new(RuntimeConfig::default()).unwrap())) - .with_query_planner(planner) - .with_session_id(session_id) - .build(); - // the SessionContext created here is the client side context, but the session_id is from server side. - SessionContext::new_with_state(session_state) -} - pub struct BallistaQueryPlanner { scheduler_url: String, config: BallistaConfig,