This is an automated email from the ASF dual-hosted git repository.
goldmedal pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 3f4297f505 feat: preserve session id when using cxt.enable_url_table()
(#14004)
3f4297f505 is described below
commit 3f4297f505887accb5e5c2afc149a03de6631f15
Author: Marko Milenković <[email protected]>
AuthorDate: Mon Jan 6 02:31:03 2025 +0000
feat: preserve session id when using cxt.enable_url_table() (#14004)
---
datafusion/core/src/execution/context/mod.rs | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/datafusion/core/src/execution/context/mod.rs
b/datafusion/core/src/execution/context/mod.rs
index 3455cce132..f20475df15 100644
--- a/datafusion/core/src/execution/context/mod.rs
+++ b/datafusion/core/src/execution/context/mod.rs
@@ -391,8 +391,11 @@ impl SessionContext {
current_catalog_list,
Arc::clone(&factory) as Arc<dyn UrlTableFactory>,
));
+
+ let session_id = self.session_id.clone();
let ctx: SessionContext = self
.into_state_builder()
+ .with_session_id(session_id)
.with_catalog_list(catalog_list)
.build()
.into();
@@ -2222,6 +2225,16 @@ mod tests {
assert_batches_eq!(expected, &result);
Ok(())
}
+ #[test]
+ fn preserve_session_context_id() -> Result<()> {
+ let ctx = SessionContext::new();
+ // it does make sense to preserve session id in this case
+ // as `enable_url_table()` can be seen as additional configuration
+ // option on ctx.
+ // some systems like datafusion ballista relies on stable session_id
+ assert_eq!(ctx.session_id(), ctx.enable_url_table().session_id());
+ Ok(())
+ }
struct MyPhysicalPlanner {}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]