diff --git a/crates/calcite-schema/src/jvm.rs b/crates/calcite-schema/src/jvm.rs index 9514942..b5e96b9 100644 --- a/crates/calcite-schema/src/jvm.rs +++ b/crates/calcite-schema/src/jvm.rs @@ -78,11 +78,8 @@ pub fn init_jvm(calcite_configuration: &ParsedConfiguration) { let state_inited = env::var("STATE_INITED").unwrap_or("false".to_string()); if state_inited == "false" { let jar_dependency_folder = env::var("JAR_DEPENDENCY_FOLDER"); - println!("Jar dependency folder is {:#?}", jar_dependency_folder); let folder_path = jar_dependency_folder.unwrap_or("/calcite-rs-jni/jni/target/dependency".into()); - println!("Folder path is {}", folder_path); let mut jar_paths = get_jar_files(&folder_path); - println!("Jar paths are {:#?}", jar_paths); let jar_name = env::var("CALCITE_JAR").unwrap_or("/calcite-rs-jni/jni/target/calcite-rs-jni-1.0-SNAPSHOT.jar".into()); if !jar_name.is_empty() { diff --git a/crates/calcite-schema/src/version5.rs b/crates/calcite-schema/src/version5.rs index a6634aa..dada124 100644 --- a/crates/calcite-schema/src/version5.rs +++ b/crates/calcite-schema/src/version5.rs @@ -58,7 +58,6 @@ impl CalciteRefSingleton { pub fn initialize(&self, args: &crate::configuration::ParsedConfiguration) -> Result<(), &'static str> { match args { crate::configuration::ParsedConfiguration::Version5(config) => { - println!("&&&&&&&&&&&&&&&&& RACHING HERE"); dotenv::dotenv().ok(); let calcite; let calcite_ref; @@ -68,12 +67,7 @@ impl CalciteRefSingleton { calcite = create_query_engine(&config, &mut env); let new_env = java_vm.attach_current_thread_as_daemon().unwrap(); calcite_ref = new_env.new_global_ref(calcite).unwrap(); - self.calcite_ref.set(calcite_ref).map_err(| _ | "Calcite Query Engine already initialized").unwrap(); - // let java_vm = get_jvm().lock().unwrap(); - // let env = java_vm.attach_current_thread_as_daemon().map_err(| _ | "Could not attach thread to JVM") ?; - // let calcite_ref = create_query_engine(&config, env).map_err(|_ | "Could not create Calcite Query Engine") ?; - // self.calcite_ref.set(calcite_ref).map_err(| _ | "Calcite Query Engine already initialized") Ok(()) } } @@ -127,7 +121,6 @@ pub fn create_query_engine<'a>(configuration: &'a ParsedConfiguration, env: &'a let class = env.find_class("com/hasura/CalciteQuery").unwrap(); let instance = env.new_object(class, "()V", &[]).unwrap(); - println!("Creating query engine with configuration: {:?}", configuration); let _ = create_jvm_connection(configuration, &instance, env).expect("Failed to create JVM connection"); event!(Level::INFO, "Instantiated Calcite Query Engine"); instance @@ -179,25 +172,6 @@ pub fn create_jvm_connection<'a, 'b>( } } -// #[tracing::instrument(skip(configuration, env), level=Level::INFO)] -// pub fn create_query_engine<'a>( -// configuration: &'a ParsedConfiguration, -// mut env: JNIEnv<'a> -// ) -> Result { -// let class = env.find_class("com/hasura/CalciteQuery")?; -// let instance = env.new_object(class, "()V", &[])?; - -// match create_jvm_connection(configuration, &instance, &mut env) { -// Ok(_) => { -// event!(Level::INFO, "Instantiated Calcite Query Engine"); -// Ok(env.new_global_ref(instance)?) -// }, -// Err(_) => { -// Err(Error::JniCall(JniError::Unknown)) -// } -// } -// } - #[tracing::instrument(skip(_environment,calcite_ref_singleton))] pub async fn introspect( args: &ParsedConfiguration, @@ -210,7 +184,6 @@ pub async fn introspect( } let calcite_ref = calcite_ref_singleton.get().unwrap(); let metadata = get_models(calcite_ref); - println!("Metadata: {:?}", metadata); let introspected = ParsedConfiguration { version: Version::This, _schema: args._schema.clone(), @@ -253,7 +226,6 @@ pub async fn parse_configuration( Ok(parsed_config) } - /// Write the parsed configuration into a directory on disk. #[tracing::instrument(skip(out_dir))] pub async fn write_parsed_configuration( @@ -264,8 +236,6 @@ pub async fn write_parsed_configuration( let configuration_file = out_dir.as_ref().to_owned().join(CONFIGURATION_FILENAME); fs::create_dir_all(out_dir.as_ref()).await?; - println!("Writing configuration to: {:?}", configuration_file); - // create the configuration file fs::write( configuration_file, diff --git a/crates/connectors/ndc-calcite/src/connector/calcite.rs b/crates/connectors/ndc-calcite/src/connector/calcite.rs index 9648cc3..d158bcb 100644 --- a/crates/connectors/ndc-calcite/src/connector/calcite.rs +++ b/crates/connectors/ndc-calcite/src/connector/calcite.rs @@ -195,6 +195,7 @@ impl Connector for Calcite { calcite_ref = env.new_global_ref(calcite).unwrap(); } + // add check for key in configuration let schema = retrieve_schema(configuration, calcite_ref.clone()); match schema { Ok(schema) => Ok(JsonResponse::from(schema)),