Commit ae86ece
committed
Address review comments on #5488
Per @penghuo review:
PlanUtils.java
- Revert mayBeFilterFromBucketNonNull to the original ternary form; drop the
early-return refactor (no behavior change, just cleaner).
- Drop the !rexCall.getOperands().isEmpty() guard before .get(0): IS NOT NULL
is always unary in Calcite, so the check is dead.
- Trim the JavaDoc to the essentials (un-merged vs merged-AND shape; concrete
partition-key match happens in PPLSimplifyDedupRule#apply).
- Promote isNotNullOnRef from package-private to public so the dedup rule can
reuse it from a different package.
PPLSimplifyDedupRule.java
- isNotNullOnPartitionKey now delegates the IS NOT NULL($ref) structural check
to PlanUtils.isNotNullOnRef and adds the partition-key index check on top.
CalciteExplainIT.java
- Add testDedupAfterWherePushDown: an end-to-end regression that runs the
shape `... | where <pred> | dedup <field>` and asserts (a) LogicalDedup
appears in the explain output (PPLSimplifyDedupRule fired even after
FilterMergeRule had a chance to merge the two filters), and (b)
EnumerableWindow does NOT appear (the in-memory ROW_NUMBER fallback the
bug caused is gone).
Signed-off-by: Jialiang Liang <jiallian@amazon.com>1 parent 0bf8f7c commit ae86ece
3 files changed
Lines changed: 37 additions & 36 deletions
File tree
- core/src/main/java/org/opensearch/sql/calcite
- plan/rule
- utils
- integ-test/src/test/java/org/opensearch/sql/calcite/remote
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
Lines changed: 9 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
812 | 793 | | |
813 | 794 | | |
814 | 795 | | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
821 | 800 | | |
822 | 801 | | |
823 | | - | |
| 802 | + | |
824 | 803 | | |
825 | 804 | | |
826 | | - | |
827 | 805 | | |
828 | 806 | | |
829 | 807 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2153 | 2153 | | |
2154 | 2154 | | |
2155 | 2155 | | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
2156 | 2179 | | |
2157 | 2180 | | |
2158 | 2181 | | |
| |||
0 commit comments