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

hongze 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 9cecf37cc [VL] Remove redundant code in VeloxParquetDatasource to 
avoid memory leakage (#6462)
9cecf37cc is described below

commit 9cecf37ccd5be592c7089655637b6273cb4d2fd6
Author: liujp <[email protected]>
AuthorDate: Wed Jul 17 12:44:08 2024 +0800

    [VL] Remove redundant code in VeloxParquetDatasource to avoid memory 
leakage (#6462)
---
 cpp/velox/operators/writer/VeloxParquetDatasource.cc | 7 -------
 cpp/velox/operators/writer/VeloxParquetDatasource.h  | 1 -
 2 files changed, 8 deletions(-)

diff --git a/cpp/velox/operators/writer/VeloxParquetDatasource.cc 
b/cpp/velox/operators/writer/VeloxParquetDatasource.cc
index 58aa9f33a..530f250b8 100644
--- a/cpp/velox/operators/writer/VeloxParquetDatasource.cc
+++ b/cpp/velox/operators/writer/VeloxParquetDatasource.cc
@@ -53,13 +53,6 @@ void VeloxParquetDatasource::initSink(const 
std::unordered_map<std::string, std:
 
 void VeloxParquetDatasource::init(const std::unordered_map<std::string, 
std::string>& sparkConfs) {
   initSink(sparkConfs);
-  ArrowSchema cSchema{};
-  arrow::Status status = arrow::ExportSchema(*(schema_.get()), &cSchema);
-  if (!status.ok()) {
-    throw std::runtime_error("Failed to export arrow cSchema.");
-  }
-
-  type_ = velox::importFromArrow(cSchema);
 
   if (sparkConfs.find(kParquetBlockSize) != sparkConfs.end()) {
     maxRowGroupBytes_ = 
static_cast<int64_t>(stoi(sparkConfs.find(kParquetBlockSize)->second));
diff --git a/cpp/velox/operators/writer/VeloxParquetDatasource.h 
b/cpp/velox/operators/writer/VeloxParquetDatasource.h
index 12cf2c301..6b68396ec 100644
--- a/cpp/velox/operators/writer/VeloxParquetDatasource.h
+++ b/cpp/velox/operators/writer/VeloxParquetDatasource.h
@@ -107,7 +107,6 @@ class VeloxParquetDatasource : public Datasource {
   int64_t maxRowGroupRows_ = 100000000; // 100M
 
   std::shared_ptr<arrow::Schema> schema_;
-  std::shared_ptr<const facebook::velox::Type> type_;
   std::shared_ptr<facebook::velox::parquet::Writer> parquetWriter_;
   std::shared_ptr<facebook::velox::memory::MemoryPool> pool_;
 };


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

Reply via email to