diff --git a/core/trino-spi/src/main/java/io/trino/spi/predicate/SortedRangeSet.java b/core/trino-spi/src/main/java/io/trino/spi/predicate/SortedRangeSet.java index 02fc4fe4fbd9..15fc01141594 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/predicate/SortedRangeSet.java +++ b/core/trino-spi/src/main/java/io/trino/spi/predicate/SortedRangeSet.java @@ -1104,17 +1104,11 @@ public Range toRange() @Override public int compareTo(RangeView that) { - int compare; - compare = compareLowBound(that); + int compare = compareLowBound(that); if (compare != 0) { return compare; } - compare = compareHighBound(that); - if (compare != 0) { - return compare; - } - - return 0; + return compareHighBound(that); } private int compareLowBound(RangeView that) diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/PartitionMatchSupplier.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/PartitionMatchSupplier.java index e91b203bcd2e..411d5c9bc704 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/PartitionMatchSupplier.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/PartitionMatchSupplier.java @@ -64,7 +64,7 @@ private boolean evaluateCurrentDynamicFilter() boolean partitionMatches = partitionMatches(partitionColumns, currentPredicate, hivePartition); if (!partitionMatches || filterIsComplete) { // Store the result to avoid re-evaluating the filter for each subsequent split - this.finalResult = (Boolean) partitionMatches; + this.finalResult = partitionMatches; } return partitionMatches; }