This is an automated email from the ASF dual-hosted git repository.
gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 0422d9d5074 Fix redundant expansion in SearchOperatorConversion.
(#15625)
0422d9d5074 is described below
commit 0422d9d50749b04b476c420dcdeb5e0572ddf82a
Author: Gian Merlino <[email protected]>
AuthorDate: Fri Jan 5 12:42:12 2024 -0800
Fix redundant expansion in SearchOperatorConversion. (#15625)
This logic error causes sarg expansion to happen twice for IN or NOT IN
points.
It doesn't affect the final generated native query, because the
redundant expansions gets combined. But it slows down planning, especially
for large NOT IN.
---
.../druid/sql/calcite/expression/builtin/SearchOperatorConversion.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/SearchOperatorConversion.java
b/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/SearchOperatorConversion.java
index 04e135f90e9..967978c8760 100644
---
a/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/SearchOperatorConversion.java
+++
b/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/SearchOperatorConversion.java
@@ -169,7 +169,7 @@ public class SearchOperatorConversion implements
SqlOperatorConversion
}
// Use RexUtil.sargRef to expand the rest of the sarg, if any.
- if (!sarg.isPoints() || !sarg.isComplementedPoints()) {
+ if (!sarg.isPoints() && !sarg.isComplementedPoints()) {
// Remaining ranges, after separating out the "IN" and "NOT IN" points.
// The "IN" points are excluded, and the "NOT IN" points are added back
in.
final RangeSet<Comparable> remainderRanges = TreeRangeSet.create();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]