feat: support DataFusion Expr in DeleteBuilder#6343
Open
wjones127 wants to merge 1 commit intolance-format:mainfrom
Open
feat: support DataFusion Expr in DeleteBuilder#6343wjones127 wants to merge 1 commit intolance-format:mainfrom
wjones127 wants to merge 1 commit intolance-format:mainfrom
Conversation
Previously, `DeleteBuilder` only accepted SQL string predicates, requiring
callers who already had a `datafusion::logical_expr::Expr` to serialize it
to a string only for it to be reparsed internally.
This adds `DeleteBuilder::from_expr(dataset, expr)` as a companion to the
existing `DeleteBuilder::new(dataset, sql)`, following the same dual-input
pattern already used in `Scanner` (`filter` vs `filter_expr`). Internally
both paths store an `ExprFilter` and dispatch to the appropriate scanner
method; the `Operation::Delete { predicate }` field serializes the expr via
`expr.to_string()` when needed.
Closes lance-format#6339
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously,
DeleteBuilderonly accepted SQL string predicates. Callers who already had adatafusion::logical_expr::Expr(e.g. from query planning) had to serialize it to a string only for it to be reparsed inside.This adds
DeleteBuilder::from_expr(dataset, expr)as a companion to the existingDeleteBuilder::new(dataset, sql), following the dual-input pattern already used inScanner(filtervsfilter_expr). Internally both paths store anExprFilterand dispatch to the appropriate scanner method. TheOperation::Delete { predicate }field serializes the expr viaexpr.to_string()when needed for transaction logging.Closes #6339
Test plan
test_delete_with_expr_filtertest verifies expr-based deletion matches the equivalent SQL path