Xianqing He has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/25190


Change subject: IMPALA-15632: Add disjunctive subsumption rewrite rule for OR 
predicates
......................................................................

IMPALA-15632: Add disjunctive subsumption rewrite rule for OR predicates

Add SimplifyDisjunctiveSubsumptionRule, which removes disjuncts that are
subsumed by another disjunct in an OR predicate. A disjunct D is subsumed
by D' if D' has a strict subset of D's conjuncts (D = D' AND E), in which
case D' OR D is equivalent to D'. Duplicate disjuncts are also removed.

The rule flattens OR trees, compares deduplicated conjunct sets, and
conservatively skips subqueries and nondeterministic functions (UDFs,
rand/random/uuid, AI functions, etc.). The 30x30 comparison bound matches
ExtractCommonConjunctRule.

Register the rule after ExtractCommonConjunctRule and before
ConvertToCNFRule, gated by the new enable_disjunctive_subsumption_rewrite
query option. The option defaults to false so existing plans are
unchanged.

Add unit and full-pipeline coverage to ExprRewriteRulesTest, and a C++
query option test. Default planner output is unchanged because the option
is off by default.

Change-Id: I5796539955f731c720e8a176fb4ec0111e934399
Assisted-by: deepseek-v4.1-flash (opencode)
---
M be/src/service/query-options-test.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/analysis/Analyzer.java
A 
fe/src/main/java/org/apache/impala/rewrite/SimplifyDisjunctiveSubsumptionRule.java
M fe/src/test/java/org/apache/impala/analysis/ExprRewriteRulesTest.java
8 files changed, 398 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/90/25190/1
--
To view, visit http://gerrit.cloudera.org:8080/25190
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5796539955f731c720e8a176fb4ec0111e934399
Gerrit-Change-Number: 25190
Gerrit-PatchSet: 1
Gerrit-Owner: Xianqing He <[email protected]>

Reply via email to