-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat(dataobj, executor): filter node execution #17327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
pkg/engine/executor/executor.go
Outdated
} | ||
|
||
return errorPipeline(errNotImplemented) | ||
return NewFilterPipeline(filter, inputs[0], &c.evaluator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The expression evaluator is stateless, so it does not require to pass a pointer.
// boolean filters are only used for filtering; they're not returned | ||
// and must be released | ||
// TODO: verify this once the evaluator implementation is fleshed out | ||
col.Release() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need a nil
check here, in case not all columns where initialized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so; it's initialized with capacity, but len=0. Length only increases when columns are added.
pkg/engine/executor/filter_test.go
Outdated
AssertPipelinesEqual(t, filterPipeline, expectedPipeline) | ||
}) | ||
|
||
t.Run("filter using valid column directly", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I found the test name confusing. The test is validating that you can filter on a boolean column with a simple ColumnExpr.
This implementation provides a foundation for more advanced filtering operations as the expression evaluator is enhanced to support more complex expressions.
👍
Add Filter Pipeline Implementation
This PR implements a filter pipeline for Loki's engine executor component. The filter operator enables row-level filtering of Arrow record batches based on boolean expressions. This is a fundamental component for query execution.
Changes
NewFilterPipeline
for evaluating filter predicates on record batchesfilterBatch
utility to efficiently filter Arrow recordsexecuteFilter
in the executor to use the new implementationImplementation Notes
The filter implementation follows the same pattern as the project pipeline, evaluating predicates against each record and creating a new filtered record based on the results. The implementation supports compound predicates with AND logic.
This implementation provides a foundation for more advanced filtering operations as the expression evaluator is enhanced to support more complex expressions.