Skip to content

refactor(sqlengine): add extensible filter set rewriting - #690

Open
egolearner wants to merge 1 commit into
alibaba:mainfrom
egolearner:refactor/filter-set-rewriting
Open

refactor(sqlengine): add extensible filter set rewriting#690
egolearner wants to merge 1 commit into
alibaba:mainfrom
egolearner:refactor/filter-set-rewriting

Conversation

@egolearner

Copy link
Copy Markdown
Collaborator

Summary

  • Centralize recursive filter normalization and introduce registries for group and set rewrite rules.
  • Fix the incorrect rewrite of OR-connected not-equal predicates into NOT IN.
  • Merge same-field equality/IN predicates under OR and inequality/NOT IN predicates under AND.
  • Deduplicate exact literals in merged results using string_view keys while leaving standalone IN/NOT IN lists unchanged.
  • Keep positive intersections under AND and semantic value canonicalization outside the initial rule set.
  • Add regression tests for rewrite boundaries, invalid literals, duplicate handling, predicate ordering, and unsatisfiable-filter propagation.

Testing

  • ninja -C build.release unittest.zvec_sqlengine
  • clang-format -n --Werror on changed C++ files
  • git diff --check

- centralize recursive filter normalization and execute group rewrites through rule registries
- prevent != predicates under OR from being incorrectly rewritten to NOT IN
- merge =/IN predicates under OR and !=/NOT IN predicates under AND
- deduplicate exact merged literals with string_view keys while preserving standalone IN/NOT IN lists
- keep AND positive intersections and semantic value canonicalization out of the initial rule set
- add regression coverage for rewrite boundaries, invalid literals, duplicate handling, and predicate ordering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant