From c7a2e3bf2022efe1437905ba76d9c5b5f9fbf162 Mon Sep 17 00:00:00 2001 From: jianpengliu Date: Tue, 16 Jul 2024 09:48:39 +0800 Subject: [PATCH] [VL] remove redundant code in parquet datasource to avoid memory leakage --- 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 58aa9f33af04..530f250b8e6e 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& 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(stoi(sparkConfs.find(kParquetBlockSize)->second)); diff --git a/cpp/velox/operators/writer/VeloxParquetDatasource.h b/cpp/velox/operators/writer/VeloxParquetDatasource.h index 12cf2c301a39..6b68396ec41a 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 schema_; - std::shared_ptr type_; std::shared_ptr parquetWriter_; std::shared_ptr pool_; };