This is an automated email from the ASF dual-hosted git repository.

rui pushed a commit to branch data_col
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git

commit 3e6d99dccc5179b6cafdc952d960675f87e8ab86
Author: Rui Mo <[email protected]>
AuthorDate: Thu May 29 21:52:17 2025 +0800

    try
---
 cpp/velox/substrait/SubstraitToVeloxPlan.cc | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/cpp/velox/substrait/SubstraitToVeloxPlan.cc 
b/cpp/velox/substrait/SubstraitToVeloxPlan.cc
index c6951fd8a9..724e53a13e 100644
--- a/cpp/velox/substrait/SubstraitToVeloxPlan.cc
+++ b/cpp/velox/substrait/SubstraitToVeloxPlan.cc
@@ -1304,14 +1304,9 @@ core::PlanNodePtr 
SubstraitToVeloxPlanConverter::toVeloxPlan(const ::substrait::
   // provided. However, to workaround the type check between element type and 
array type for unannotated array, for
   // array type the requested type is set to nullptr.
   auto names = colNameList;
-  std::vector<TypePtr> types;
-  for (const auto& type : veloxTypeList) {
-    if (type->kind() == TypeKind::ARRAY) {
-      types.push_back(nullptr);
-    } else {
-      types.emplace_back(type);
-    }
-  }
+  auto types = veloxTypeList;
+  bool needsRequestedType = std::any_of(
+      veloxTypeList.begin(), veloxTypeList.end(), [](const auto& type) { 
return type->kind() == TypeKind::VARCHAR; });
   auto dataColumns = ROW(std::move(names), std::move(types));
 
   // Velox requires Filter Pushdown must being enabled.
@@ -1319,7 +1314,12 @@ core::PlanNodePtr 
SubstraitToVeloxPlanConverter::toVeloxPlan(const ::substrait::
   std::shared_ptr<connector::hive::HiveTableHandle> tableHandle;
   if (!readRel.has_filter()) {
     tableHandle = std::make_shared<connector::hive::HiveTableHandle>(
-        kHiveConnectorId, "hive_table", filterPushdownEnabled, 
common::SubfieldFilters{}, nullptr, dataColumns);
+        kHiveConnectorId,
+        "hive_table",
+        filterPushdownEnabled,
+        common::SubfieldFilters{},
+        nullptr,
+        needsRequestedType ? dataColumns : nullptr);
   } else {
     common::SubfieldFilters subfieldFilters;
     auto remainingFilter = exprConverter_->toVeloxExpr(readRel.filter(), 
dataColumns);
@@ -1330,7 +1330,7 @@ core::PlanNodePtr 
SubstraitToVeloxPlanConverter::toVeloxPlan(const ::substrait::
         filterPushdownEnabled,
         std::move(subfieldFilters),
         remainingFilter,
-        dataColumns);
+        needsRequestedType ? dataColumns : nullptr);
   }
 
   // Get assignments and out names.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to