physical-expr-common: deprecate PhysicalExpr::snapshot method#21975
physical-expr-common: deprecate PhysicalExpr::snapshot method#21975jayshrivastava wants to merge 4 commits intoapache:mainfrom
PhysicalExpr::snapshot method#21975Conversation
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
682e97c to
9aec9f2
Compare
PhysicalExpr::snapshot method
|
@jayshrivastava can you rebase please? |
9aec9f2 to
988ae5d
Compare
|
Rebased! |
There was a problem hiding this comment.
I think there's little reason to not deprecate and stop using instead of removing altogether: https://datafusion.apache.org/contributor-guide/api-health.html#deprecation-guidelines
As far as I can tell it wouldn't be a big pain or impede future development much to keep these methods around as deprecated?
Which issue does this PR close? See apache#21807 Rationale for this change `PhysicalExpr::snapshot` isn't required because it only applies to dynamic filters. The only place that its used is in `pruning_predicate.rs`. Since there's only one use case, we can just downcast to `DynamicFilterPhysicalExpr` and call `current()`. What changes are included in this PR? This change marks `PhysicalExpr::snapshot`, `snapshot_physical_expr`, and `snapshot_physical_expr_opt` as deprecated. Callers should downcast to `DynamicFilterPhysicalExpr` and call `current()`. Are these changes tested? Yes, the existing tests should cover the exact same functionality. Filter pushdown still workers with dynamic filters; we use `current()` instead of `snapshot()` to capture the expression. Are there any user-facing changes? `PhysicalExpr::snapshot`, `snapshot_physical_expr`, and `snapshot_physical_expr_opt` are deprecated and should not be used.
467c413 to
8e9e6c4
Compare
| assert!(arr_1.eq(&expected)); | ||
| } | ||
|
|
||
| #[allow(deprecated)] |
There was a problem hiding this comment.
I did not remove/edit
- Tests that call
snapshot() - Implementations of
snapshot()ex. forDynamicFilterPhysicalExpr
Please let me know if this is the correct way to deprecate things!
|
Thanks @jayshrivastava ! My main concern with merging this right now is that it doesn't seem like a big pain point / blocker anymore to have this API. And removing it is code churn. Especially if we find a user for it later. I'm thinking in particular about other "thin, runtime only" expression wrappers, e.g. |
PhysicalExpr::snapshot methodPhysicalExpr::snapshot method
I agree. It was a small PR so I went ahead and implemented it. It's not a blocker for me. If you feel that it's better to leave it unmerged, I'm okay with that! |
Which issue does this PR close?
See #21807
Rationale for this change
PhysicalExpr::snapshotisn't required because it only applies todynamic filters. The only place that its used is in
pruning_predicate.rs. Since there's only one use case, we can justdowncast to
DynamicFilterPhysicalExprand callcurrent().What changes are included in this PR?
This change marks
PhysicalExpr::snapshot,snapshot_physical_expr, andsnapshot_physical_expr_optasdeprecated. Callers should downcast to
DynamicFilterPhysicalExprand callcurrent().Are these changes tested?
Yes, the existing tests should cover the exact same functionality.
Filter pushdown still workers with dynamic filters; we use
current()instead of
snapshot()to capture the expression.Are there any user-facing changes?
PhysicalExpr::snapshot,snapshot_physical_expr, andsnapshot_physical_expr_optare deprecated and should not be used.