clintropolis commented on a change in pull request #8209: add mechanism to control filter optimization in historical query processing URL: https://github.com/apache/incubator-druid/pull/8209#discussion_r310807921
########## File path: processing/src/main/java/org/apache/druid/query/filter/BoundDimFilter.java ########## @@ -263,43 +290,30 @@ public boolean equals(Object o) if (o == null || getClass() != o.getClass()) { return false; } - BoundDimFilter that = (BoundDimFilter) o; - - if (isLowerStrict() != that.isLowerStrict()) { - return false; - } - if (isUpperStrict() != that.isUpperStrict()) { - return false; - } - if (!getDimension().equals(that.getDimension())) { - return false; - } - if (getUpper() != null ? !getUpper().equals(that.getUpper()) : that.getUpper() != null) { - return false; - } - if (getLower() != null ? !getLower().equals(that.getLower()) : that.getLower() != null) { - return false; - } - if (getExtractionFn() != null - ? !getExtractionFn().equals(that.getExtractionFn()) - : that.getExtractionFn() != null) { - return false; - } - return getOrdering().equals(that.getOrdering()); + return lowerStrict == that.lowerStrict && + upperStrict == that.upperStrict && + dimension.equals(that.dimension) && + Objects.equals(upper, that.upper) && + Objects.equals(lower, that.lower) && + Objects.equals(extractionFn, that.extractionFn) && + Objects.equals(ordering, that.ordering) && + Objects.equals(filterTuning, that.filterTuning); } @Override public int hashCode() { - int result = getDimension().hashCode(); - result = 31 * result + (getUpper() != null ? getUpper().hashCode() : 0); - result = 31 * result + (getLower() != null ? getLower().hashCode() : 0); - result = 31 * result + (isLowerStrict() ? 1 : 0); - result = 31 * result + (isUpperStrict() ? 1 : 0); - result = 31 * result + (getExtractionFn() != null ? getExtractionFn().hashCode() : 0); - result = 31 * result + getOrdering().hashCode(); - return result; + return Objects.hash( + dimension, + upper, + lower, + lowerStrict, + upperStrict, + extractionFn, + ordering, + filterTuning + ); } @Override Review comment: I'm not exactly sure the best way to add `filterTuning` to the `toString` output of these `DimFilter` with non-standard implementations, I guess a parenthesis maybe? e.g. `(filterTuning=...` ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org