[native] Better error message when filter conversion is not supported.
@@ -536,9 +536,8 @@ std::unique_ptr<common::Filter> toFilter(
const protocol::Domain& domain,
const VeloxExprConverter& exprConverter) {
auto nullAllowed = domain.nullAllowed;
- auto sortedRangeSet =
- std::dynamic_pointer_cast<protocol::SortedRangeSet>(domain.values);
- VELOX_CHECK(sortedRangeSet, "Unsupported ValueSet type");
+ if (auto sortedRangeSet =
+ std::dynamic_pointer_cast<protocol::SortedRangeSet>(domain.values)) {
auto type = stringToType(sortedRangeSet->type);
auto ranges = sortedRangeSet->ranges;
@@ -564,7 +563,8 @@ std::unique_ptr<common::Filter> toFilter(
}
if (type->kind() == TypeKind::BIGINT || type->kind() == TypeKind::INTEGER ||
- type->kind() == TypeKind::SMALLINT || type->kind() == TypeKind::TINYINT) {
+ type->kind() == TypeKind::SMALLINT ||
+ type->kind() == TypeKind::TINYINT) {
std::vector<std::unique_ptr<common::BigintRange>> bigintFilters;
bigintFilters.reserve(ranges.size());
for (const auto& range : ranges) {
@@ -588,7 +588,8 @@ std::unique_ptr<common::Filter> toFilter(
VELOX_CHECK_EQ(ranges.size(), 2, "Multi bool ranges size can only be 2.");
std::unique_ptr<common::Filter> boolFilter;
for (const auto& range : ranges) {
- auto filter = boolRangeToFilter(range, nullAllowed, exprConverter, type);
+ auto filter =
+ boolRangeToFilter(range, nullAllowed, exprConverter, type);
if (filter->kind() == common::FilterKind::kAlwaysFalse or
filter->kind() == common::FilterKind::kIsNull) {
continue;
@@ -609,6 +610,20 @@ std::unique_ptr<common::Filter> toFilter(
return std::make_unique<common::MultiRange>(
std::move(filters), nullAllowed, false);
+ } else if (
+ auto equatableValueSet =
+ std::dynamic_pointer_cast<protocol::EquatableValueSet>(
+ domain.values)) {
+ VELOX_UNSUPPORTED(
+ "EquatableValueSet to Velox filter conversion is not supported yet.");
+ } else if (
+ auto allOrNoneValueSet =
+ std::dynamic_pointer_cast<protocol::AllOrNoneValueSet>(
+ domain.values)) {
+ VELOX_UNSUPPORTED(
+ "AllOrNoneValueSet to Velox filter conversion is not supported yet.");
+ }
+ VELOX_UNSUPPORTED("Unsupported filter found.");
}
std::shared_ptr<connector::ConnectorTableHandle> toConnectorTableHandle(
