Allow filters to use extraction functions#2690
Conversation
|
updated docs |
|
rebased, removed conflicts with #2711 |
|
I think |
There was a problem hiding this comment.
cause extraction itself is handled in predicate, I think we don't need this here (can be confusing).
There was a problem hiding this comment.
@navis thanks, extractionFn was unnecessary here, removed it
There was a problem hiding this comment.
but now it's necessary again, right?
There was a problem hiding this comment.
yes, it's being used now
|
sorry @jon-wei, more conflicts! |
|
re: changing SelectorFilter and JavascriptFilter to implement DimensionPredicateFilter There are some performance considerations if that change were made:
I think, if that change is desirable, it's better handled in a separate PR. |
|
@gianm np, rebasing now |
|
rebased |
|
@jon-wei Pair enough. 👍 |
There was a problem hiding this comment.
Is this constructor needed? If it's only used for tests then usually we modify the tests rather than add another constructor.
(similar comment for all the other filters)
There was a problem hiding this comment.
IMO one nice thing about only having one constructor is that it makes it harder to accidentally create an object with a critical parameter missing.
60a896a to
a34c2f1
Compare
|
rebased |
There was a problem hiding this comment.
why not return new SelectorDimFilter(dimension, value, extractionFn).optimize();?
There was a problem hiding this comment.
@gianm changed to use SelectorDimFilter optimize()
There was a problem hiding this comment.
This could be optimized in a similar way to the SelectorDimFilter.
There was a problem hiding this comment.
@gianm Can we handle the InDimFilter optimization in a separate PR?
There was a problem hiding this comment.
sure, you can file an issue for anything you don't think is appropriate for this PR.
There was a problem hiding this comment.
keys isn't guaranteed to be mutable, so it'd be better to copy it and add convertedValue to the copy.
There was a problem hiding this comment.
this looks good to me other than that
|
lgtm 👍 |
This PR allows the user to define an extraction function on each of the filters (except SpatialFilter); the extraction function will be applied to the input before the filter criteria is applied.
This merges the SelectorFilter and ExtractionFilter into a single class (ExtractionDimFilter is deprecated in this patch, ExtractionFilter has been deleted).
Fixes #2643
Also fixes #2772, #2775, #2776