Skip to content

Commit 0726087

Browse files
Fix deprecation version to 52.0.0 and add upgrading guide entry
- Updated deprecation version from 51.0.0 to 52.0.0 for FilterExec methods - Added comprehensive entry to upgrading.md explaining the migration path - All 114 filter tests passing
1 parent 26e5c46 commit 0726087

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

datafusion/physical-plan/src/filter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl FilterExec {
198198
///
199199
/// # Deprecated
200200
/// Use [`FilterExecBuilder::with_default_selectivity`] instead
201-
#[deprecated(since = "51.0.0", note = "Use FilterExecBuilder::with_default_selectivity instead")]
201+
#[deprecated(since = "52.0.0", note = "Use FilterExecBuilder::with_default_selectivity instead")]
202202
pub fn with_default_selectivity(
203203
self,
204204
default_selectivity: u8,
@@ -215,7 +215,7 @@ impl FilterExec {
215215
///
216216
/// # Deprecated
217217
/// Use [`FilterExecBuilder::with_projection`] instead
218-
#[deprecated(since = "51.0.0", note = "Use FilterExecBuilder::with_projection instead")]
218+
#[deprecated(since = "52.0.0", note = "Use FilterExecBuilder::with_projection instead")]
219219
pub fn with_projection(&self, projection: Option<Vec<usize>>) -> Result<Self> {
220220
// Check if the projection is valid
221221
can_project(&self.schema(), projection.as_ref())?;
@@ -240,7 +240,7 @@ impl FilterExec {
240240
///
241241
/// # Deprecated
242242
/// Use [`FilterExecBuilder::with_batch_size`] instead
243-
#[deprecated(since = "51.0.0", note = "Use FilterExecBuilder::with_batch_size instead")]
243+
#[deprecated(since = "52.0.0", note = "Use FilterExecBuilder::with_batch_size instead")]
244244
pub fn with_batch_size(&self, batch_size: usize) -> Result<Self> {
245245
FilterExecBuilder::new(self.predicate.clone(), self.input.clone())
246246
.with_projection(self.projection.clone())

docs/source/library-user-guide/upgrading.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,41 @@
2525

2626
You can see the current [status of the `52.0.0`release here](https://github.com/apache/datafusion/issues/18566)
2727

28+
### `FilterExec` builder methods deprecated
29+
30+
The following methods on `FilterExec` have been deprecated in favor of using `FilterExecBuilder`:
31+
32+
- `with_projection()`
33+
- `with_default_selectivity()`
34+
- `with_batch_size()`
35+
36+
**Who is affected:**
37+
38+
- Users who create `FilterExec` instances and use these methods to configure them
39+
40+
**Migration guide:**
41+
42+
Use `FilterExecBuilder` instead of chaining method calls on `FilterExec`:
43+
44+
**Before:**
45+
46+
```rust,ignore
47+
let filter = FilterExec::try_new(predicate, input)?
48+
.with_projection(Some(vec![0, 2]))?
49+
.with_default_selectivity(30)?;
50+
```
51+
52+
**After:**
53+
54+
```rust,ignore
55+
let filter = FilterExecBuilder::new(predicate, input)
56+
.with_projection(Some(vec![0, 2]))
57+
.with_default_selectivity(30)
58+
.build()?;
59+
```
60+
61+
The builder pattern is more efficient as it computes properties once during `build()` rather than recomputing them for each method call.
62+
2863
### Changes to DFSchema API
2964

3065
To permit more efficient planning, several methods on `DFSchema` have been

0 commit comments

Comments
 (0)