neilconway commented on code in PR #24179:
URL: https://github.com/apache/datafusion/pull/24179#discussion_r3758153838
##########
datafusion-cli/src/main.rs:
##########
@@ -244,8 +250,11 @@ async fn main_inner() -> Result<()> {
let runtime_env = rt_builder.build_arc()?;
// enable dynamic file query
- let ctx = SessionContext::new_with_config_rt(session_config, runtime_env)
+ let mut ctx = SessionContext::new_with_config_rt(session_config,
runtime_env)
.enable_url_table();
+ if args.spark {
+ datafusion_spark::register_all(&mut ctx)?;
+ }
Review Comment:
This registers the Spark UDFs but it doesn't enable the Spark function
planner, which I think we would also want in order to get consistent behavior.
I think `SessionStateBuilder::with_spark_features()` is the most idiomatic way
to do this, e.g., something like
```rust
let mut builder = SessionStateBuilder::new()
.with_config(session_config)
.with_runtime_env(runtime_env)
.with_default_features();
if args.spark {
builder = builder.with_spark_features();
}
let mut ctx =
SessionContext::new_with_state(builder.build()).enable_url_table();
```
--
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]