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

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


The following commit(s) were added to refs/heads/main by this push:
     new e32003ab07 [GLUTEN-9057][VL] Avoid flatten unnecessary vector in 
ColumnarBatch.select (#9058)
e32003ab07 is described below

commit e32003ab079486a011a0ae106e1010230d8660e5
Author: WangGuangxin <[email protected]>
AuthorDate: Wed Mar 26 08:27:16 2025 -0700

    [GLUTEN-9057][VL] Avoid flatten unnecessary vector in ColumnarBatch.select 
(#9058)
---
 cpp/velox/memory/VeloxColumnarBatch.cc                        | 7 +++----
 cpp/velox/operators/serializer/VeloxColumnarToRowConverter.cc | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/cpp/velox/memory/VeloxColumnarBatch.cc 
b/cpp/velox/memory/VeloxColumnarBatch.cc
index 5b7fba9796..d6e66b94a3 100644
--- a/cpp/velox/memory/VeloxColumnarBatch.cc
+++ b/cpp/velox/memory/VeloxColumnarBatch.cc
@@ -147,17 +147,16 @@ std::shared_ptr<VeloxColumnarBatch> 
VeloxColumnarBatch::select(
   std::vector<VectorPtr> childVectors;
   childNames.reserve(columnIndices.size());
   childVectors.reserve(columnIndices.size());
-  auto vector = getFlattenedRowVector();
-  auto type = facebook::velox::asRowType(vector->type());
+  auto type = facebook::velox::asRowType(rowVector_->type());
 
   for (uint32_t i = 0; i < columnIndices.size(); i++) {
     auto index = columnIndices[i];
-    auto child = vector->childAt(index);
+    auto child = rowVector_->childAt(index);
     childNames.push_back(type->nameOf(index));
     childVectors.push_back(child);
   }
 
-  auto rowVector = makeRowVector(pool, numRows(), std::move(childNames), 
vector->nulls(), std::move(childVectors));
+  auto rowVector = makeRowVector(pool, numRows(), std::move(childNames), 
rowVector_->nulls(), std::move(childVectors));
   return std::make_shared<VeloxColumnarBatch>(rowVector);
 }
 
diff --git a/cpp/velox/operators/serializer/VeloxColumnarToRowConverter.cc 
b/cpp/velox/operators/serializer/VeloxColumnarToRowConverter.cc
index 91ff219a7e..18720534e7 100644
--- a/cpp/velox/operators/serializer/VeloxColumnarToRowConverter.cc
+++ b/cpp/velox/operators/serializer/VeloxColumnarToRowConverter.cc
@@ -70,7 +70,7 @@ void 
VeloxColumnarToRowConverter::refreshStates(facebook::velox::RowVectorPtr ro
 
 void VeloxColumnarToRowConverter::convert(std::shared_ptr<ColumnarBatch> cb, 
int64_t startRow) {
   auto veloxBatch = VeloxColumnarBatch::from(veloxPool_.get(), cb);
-  refreshStates(veloxBatch->getRowVector(), startRow);
+  refreshStates(veloxBatch->getFlattenedRowVector(), startRow);
 
   // Initialize the offsets_ , lengths_
   lengths_.clear();


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

Reply via email to