Commit 021cc3b
authored
feat: session-first DataFusion integration + session resolution policies (delta-io#4145)
# Description
Make delta-rs' DataFusion integration consistently honor caller provided
sessions and introduce a session first API for registering Delta object
stores.
**Changes:**
Session resolution:
- Add `resolve_session_state(...)` & `SessionFallbackPolicy`
(`InternalDefaults` / `DeriveFromTrait` / `RequireSessionState`)
- Builders expose `with_session_fallback_policy(...)` to control
strictness
- Migrate operations to use resolver
(optimize/merge/update/write/delete)
Session first registration:
- Add `DeltaSessionExt` trait:
- `ensure_object_store_registered(...)`
- `ensure_log_store_registered(...)`
- Deprecate `DeltaTable::update_datafusion_session(...)` (shim kept for
compatibility)
Predicate parsing:
- Non-`SessionState` sessions can preserve UDFs when configured via
`DeriveFromTrait`
**Compatibility:**
- Default is backward compatible:
`SessionFallbackPolicy::InternalDefaults` warns but doesn't break
- Strict mode available:
`with_session_fallback_policy(RequireSessionState)` errors instead of
falling back
- `DeltaTable::update_datafusion_session` remains but is deprecated
**Tests:**
- Regression tests for fallback policy wiring across builders
(`RequireSessionState` path)
- Existing `deltalake-core` DataFusion test suite passes with
`--features datafusion`
# Related Issue(s)
**Addresses:**
- delta-io#4081
- delta-io#4139
<!---
For example:
- closes #106
--->
# Documentation
<!---
Share links to useful documentation
--->
# Follow ups:
- Flip default to `RequireSessionState` (breaking change)
- Remove deprecated `DeltaTable::update_datafusion_session` after
deprecation window
---------
Signed-off-by: Ethan Urbanski <ethan@urbanskitech.com>1 parent c095787 commit 021cc3b
17 files changed
Lines changed: 946 additions & 108 deletions
File tree
- crates/core
- src
- delta_datafusion
- logstore
- operations
- merge
- write
- test_utils
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | | - | |
| 197 | + | |
200 | 198 | | |
201 | 199 | | |
202 | 200 | | |
203 | 201 | | |
204 | 202 | | |
205 | 203 | | |
206 | 204 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
214 | 217 | | |
215 | 218 | | |
216 | | - | |
| 219 | + | |
| 220 | + | |
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
220 | | - | |
| 224 | + | |
221 | 225 | | |
222 | 226 | | |
223 | 227 | | |
| |||
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
286 | | - | |
| 290 | + | |
287 | 291 | | |
288 | 292 | | |
289 | 293 | | |
| |||
585 | 589 | | |
586 | 590 | | |
587 | 591 | | |
588 | | - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
589 | 595 | | |
590 | 596 | | |
591 | 597 | | |
| |||
594 | 600 | | |
595 | 601 | | |
596 | 602 | | |
597 | | - | |
| 603 | + | |
598 | 604 | | |
599 | 605 | | |
| 606 | + | |
600 | 607 | | |
601 | 608 | | |
| 609 | + | |
602 | 610 | | |
603 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
604 | 615 | | |
605 | 616 | | |
606 | 617 | | |
| |||
722 | 733 | | |
723 | 734 | | |
724 | 735 | | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
725 | 764 | | |
726 | 765 | | |
727 | 766 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| |||
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
55 | | - | |
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
62 | | - | |
63 | 60 | | |
64 | 61 | | |
65 | 62 | | |
| 63 | + | |
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
| |||
93 | 91 | | |
94 | 92 | | |
95 | 93 | | |
| 94 | + | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | 310 | | |
319 | 311 | | |
320 | 312 | | |
| |||
641 | 633 | | |
642 | 634 | | |
643 | 635 | | |
| 636 | + | |
644 | 637 | | |
645 | 638 | | |
646 | 639 | | |
| |||
0 commit comments