refactor filters
- Dominant language
- Java
- Stars
- 14.1k
- Forks
- 3.8k
- Avg merge
- 2d 58m
- Merged PRs (30d)
- 233
Description
### Description
`DimFilter` has a lot of repeated code between different implementations due to everything having an `extractionFn` and soon, a `filterTuning` following #8209. See [this comment](https://github.com/apache/incubator-druid/pull/8209#discussion_r311680045), and this is semi-related to #8242 in that it is suggesting a path to remove `extractionFn` from `DimFilter` so coordination is probably required.
Additionally, I think `DimFilter` and `Filter` can be combined, I understand they exist as separate entities so that `DimFilter` could be a light-weight 'client' object that was unaware of selectors and such, but this doesn't seem necessary with the current design of things and there is a lot of redundant stuff going on here that could be improved.
Finally, there is some room for improvements in how tests are creating `DimFilters`, so static methods to create filters for testing so passing in `null` for `extractionFn` and `filterTuning` should be added to decouple tests from the json schema of filters.
Contributor guide
Research direction
Start by comparing the DimFilter implementations with Filter, then read the discussion linked from #8209 and the related issue #8242 to understand coordination and scope. Review the tests that construct DimFilters as well. Done means the repeated filter state and abstractions are addressed consistently, with test construction decoupled from the JSON schema.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- database
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100