From 99bca44bea2aed974badbea200a8ef35b1fa8f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E6=B7=BB?= Date: Tue, 16 Jul 2024 10:10:29 +0800 Subject: [PATCH] [VL] Do not pushdown filters with HUGEINT columns --- cpp/velox/substrait/SubstraitToVeloxPlan.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cpp/velox/substrait/SubstraitToVeloxPlan.cc b/cpp/velox/substrait/SubstraitToVeloxPlan.cc index 7b41f7071e84..9366b87fdcaa 100644 --- a/cpp/velox/substrait/SubstraitToVeloxPlan.cc +++ b/cpp/velox/substrait/SubstraitToVeloxPlan.cc @@ -1737,6 +1737,7 @@ void SubstraitToVeloxPlanConverter::separateFilters( // Check if the condition is supported to be pushed down. uint32_t fieldIdx; if (canPushdownFunction(scalarFunction, filterName, fieldIdx) && + veloxTypeList[fieldIdx]->kind() != TypeKind::HUGEINT && rangeRecorders.at(fieldIdx).setCertainRangeForFunction(filterName)) { subfieldFunctions.emplace_back(scalarFunction); } else { @@ -2141,10 +2142,7 @@ void SubstraitToVeloxPlanConverter::constructSubfieldFilters( bool existIsNullAndIsNotNull = filterInfo.forbidsNullSet_ && filterInfo.isNullSet_; uint32_t rangeSize = std::max(filterInfo.lowerBounds_.size(), filterInfo.upperBounds_.size()); - if constexpr (KIND == facebook::velox::TypeKind::HUGEINT) { - // TODO: open it when the Velox's modification is ready. - VELOX_NYI("constructSubfieldFilters not support for HUGEINT type"); - } else if constexpr (KIND == facebook::velox::TypeKind::BOOLEAN) { + if constexpr (KIND == facebook::velox::TypeKind::BOOLEAN) { // Handle bool type filters. // Not equal. if (filterInfo.notValue_) { @@ -2381,10 +2379,11 @@ connector::hive::SubfieldFilters SubstraitToVeloxPlanConverter::mapToFilters( constructSubfieldFilters( colIdx, inputNameList[colIdx], inputType, columnToFilterInfo[colIdx], filters); break; - case TypeKind::HUGEINT: - constructSubfieldFilters( - colIdx, inputNameList[colIdx], inputType, columnToFilterInfo[colIdx], filters); - break; + // If support pushing down HUGEINT filters, we can open it + // case TypeKind::HUGEINT: + // constructSubfieldFilters( + // colIdx, inputNameList[colIdx], inputType, columnToFilterInfo[colIdx], filters); + // break; case TypeKind::ARRAY: constructSubfieldFilters( colIdx, inputNameList[colIdx], inputType, columnToFilterInfo[colIdx], filters);