suneet-s commented on a change in pull request #9800:
URL: https://github.com/apache/druid/pull/9800#discussion_r420309748



##########
File path: 
processing/src/main/java/org/apache/druid/query/filter/AndDimFilter.java
##########
@@ -72,8 +73,20 @@ public AndDimFilter(DimFilter... fields)
   @Override
   public DimFilter optimize()
   {
-    List<DimFilter> elements = DimFilters.optimize(fields);
-    return elements.size() == 1 ? elements.get(0) : new AndDimFilter(elements);
+    List<DimFilter> elements = DimFilters.optimize(fields)
+                                         .stream()
+                                         .filter(filter -> !(filter instanceof 
TrueDimFilter))
+                                         .collect(Collectors.toList());
+    if (elements.isEmpty()) {
+      // All elements were TrueDimFilter after optimization
+      return TrueDimFilter.instance();
+    } else if (elements.size() == 1) {
+      return elements.get(0);

Review comment:
       AndDimFilterTest is missing branch coverage for this and line 88




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to