diff --git a/presto-orc/src/main/java/io/prestosql/orc/AbstractOrcRecordReader.java b/presto-orc/src/main/java/io/prestosql/orc/AbstractOrcRecordReader.java index c9f208d1a..10e41c90e 100644 --- a/presto-orc/src/main/java/io/prestosql/orc/AbstractOrcRecordReader.java +++ b/presto-orc/src/main/java/io/prestosql/orc/AbstractOrcRecordReader.java @@ -342,19 +342,17 @@ abstract class AbstractOrcRecordReader if (!andDomainMap.isEmpty()) { List> matchings = new ArrayList<>(andDomainMap.size()); for (Map.Entry e : andDomainMap.entrySet()) { - Iterator lookUpRes = e.getKey().lookUp(e.getValue()); - if (lookUpRes != null) { - matchings.add(lookUpRes); + try { + Iterator lookUpRes = e.getKey().lookUp(e.getValue()); + if (lookUpRes != null) { + matchings.add(lookUpRes); + } + else if (!e.getKey().matches(e.getValue())) { + return true; + } } - else { - try { - if (!e.getKey().matches(e.getValue())) { - return true; - } - } - catch (UnsupportedOperationException uoe2) { - return false; - } + catch (UnsupportedOperationException uoe2) { + return false; } } if (!matchings.isEmpty()) { @@ -366,23 +364,21 @@ abstract class AbstractOrcRecordReader } if (!orDomainMap.isEmpty()) { for (Map.Entry e : orDomainMap.entrySet()) { - Iterator thisStripeMatchingRows = e.getKey().lookUp(e.getValue()); - if (thisStripeMatchingRows != null) { - if (thisStripeMatchingRows.hasNext()) { - /* any one matched; then include the stripe */ - return false; - } - } - else { - try { - if (e.getKey().matches(e.getValue())) { + try { + Iterator thisStripeMatchingRows = e.getKey().lookUp(e.getValue()); + if (thisStripeMatchingRows != null) { + if (thisStripeMatchingRows.hasNext()) { + /* any one matched; then include the stripe */ return false; } } - catch (UnsupportedOperationException uoe2) { + else if (e.getKey().matches(e.getValue())) { return false; } } + catch (UnsupportedOperationException uoe2) { + return false; + } } return true; }