milenkovicm commented on code in PR #100:
URL: https://github.com/apache/datafusion-java/pull/100#discussion_r3364733815


##########
native/src/lib.rs:
##########
@@ -117,6 +117,42 @@ fn install_memory_tracker(
     tracker
 }
 
+/// Build a `SessionContext` from a prepared config + runtime env. When
+/// `spark_functions` is set, register Apache Spark-compatible functions and
+/// expression planners via the `datafusion-spark` crate (requires the `spark`
+/// Cargo feature); otherwise build the plain context. Returns an error if the
+/// caller asked for Spark functions in a build that compiled the feature off.
+fn build_session_context(
+    config: SessionConfig,
+    runtime_env: Arc<RuntimeEnv>,
+    spark_functions: bool,
+) -> JniResult<SessionContext> {
+    if spark_functions {
+        #[cfg(feature = "spark")]
+        {
+            use datafusion::execution::SessionStateBuilder;
+            use datafusion_spark::SessionStateBuilderSpark;
+            // Order matters: `with_spark_features` runs after
+            // `with_default_features` so Spark implementations override the
+            // DataFusion built-ins of the same name.
+            let state = SessionStateBuilder::new()

Review Comment:
   There is `SessionStateBuilder::new_with_default_features()` it may male this 
part simpler and comment unnecessary 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to