diff --git a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.cpp b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.cpp index f5fc2968d5b4c..e460a641f4dc6 100644 --- a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.cpp +++ b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.cpp @@ -614,8 +614,15 @@ std::unique_ptr toFilter( auto equatableValueSet = std::dynamic_pointer_cast( domain.values)) { + if (equatableValueSet->entries.empty()) { + if (nullAllowed) { + return std::make_unique(); + } else { + return std::make_unique(); + } + } VELOX_UNSUPPORTED( - "EquatableValueSet to Velox filter conversion is not supported yet."); + "EquatableValueSet (with non-empty entries) to Velox filter conversion is not supported yet."); } else if ( auto allOrNoneValueSet = std::dynamic_pointer_cast( diff --git a/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestHiveQueries.java b/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestHiveQueries.java index 959b406352464..6f048f02a3420 100644 --- a/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestHiveQueries.java +++ b/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestHiveQueries.java @@ -596,6 +596,10 @@ public void testIsNullIsNotNull() { assertQuery("SELECT count(*) FROM orders where clerk is not null"); assertQuery("SELECT count(*) FROM orders where clerk is null"); + assertQuery("select count(*) from orders_ex where quantities is null"); + assertQuery("select count(*) from orders_ex where quantities is not null"); + assertQuery("select count(*) from orders_ex where quantity_by_linenumber is null"); + assertQuery("select count(*) from orders_ex where quantity_by_linenumber is not null"); } @Test