From c00cdc86dca495b9bcbc56ae4388ba0838560baa Mon Sep 17 00:00:00 2001 From: philo Date: Tue, 20 Sep 2022 11:20:45 +0800 Subject: [PATCH] Fix issue caused by rebasing --- .../arrow_compute/ext/window_kernel.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/window_kernel.cc b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/window_kernel.cc index 723f55e30..96e9925d2 100644 --- a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/window_kernel.cc +++ b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/window_kernel.cc @@ -478,7 +478,6 @@ arrow::Status WindowRankKernel::Finish(ArrayList* out) { return arrow::Status::OK(); } -static arrow::Status EncodeIndices(std::vector> in, WindowLagKernel::WindowLagKernel(arrow::compute::ExecContext* ctx, std::vector> type_list, std::shared_ptr sorter, bool desc, @@ -588,7 +587,7 @@ arrow::Status WindowLagKernel::Finish(ArrayList* out) { #endif // initialize partitions to be sorted - std::vector>> partitions_to_sort; + std::vector>> partitions_to_sort; for (int i = 0; i <= max_group_id; i++) { partitions_to_sort.emplace_back(); } @@ -605,18 +604,18 @@ arrow::Status WindowLagKernel::Finish(ArrayList* out) { } uint64_t partition_id = slice->GetView(j); partitions_to_sort.at(partition_id) - .push_back(std::make_shared(i, j)); + .push_back(std::make_shared(i, j)); } } #ifdef DEBUG std::cout << "[window kernel] Finished. " << std::endl; #endif - std::vector>> sorted_partitions; + std::vector>> sorted_partitions; RETURN_NOT_OK(SortToIndicesPrepare(values)); for (int i = 0; i <= max_group_id; i++) { - std::vector> partition = partitions_to_sort.at(i); - std::vector> sorted_partition; + std::vector> partition = partitions_to_sort.at(i); + std::vector> sorted_partition; #ifdef DEBUG std::cout << "[window kernel] Sorting a single partition... " << std::endl; #endif @@ -668,7 +667,7 @@ arrow::Status WindowLagKernel::Finish(ArrayList* out) { template arrow::Status WindowLagKernel::HandleSortedPartition(std::vector &values, std::vector> &group_ids, int32_t max_group_id, - std::vector>> &sorted_partitions, ArrayList* out) { + std::vector>> &sorted_partitions, ArrayList* out) { CType** lag_array = new CType*[group_ids.size()]; for (int i = 0; i < group_ids.size(); i++) { *(lag_array + i) = new CType[group_ids.at(i)->length()]; @@ -681,10 +680,10 @@ arrow::Status WindowLagKernel::HandleSortedPartition(std::vector &val } for (int i = 0; i <= max_group_id; i++) { - std::vector> sorted_partition = sorted_partitions.at(i); + std::vector> sorted_partition = sorted_partitions.at(i); for (int j = 0; j < sorted_partition.size(); j++) { - std::shared_ptr index = sorted_partition.at(j); + std::shared_ptr index = sorted_partition.at(j); int res_index = j - offset_; for (int column_id = 0; column_id < type_list_.size(); column_id++) { if (res_index < 0 || res_index > sorted_partition.size() - 1) { @@ -737,7 +736,7 @@ arrow::Status WindowLagKernel::HandleSortedPartition(std::vector &val } // TODO: use reference to avoid unnecessary copy? -static arrow::Status EncodeIndices(std::vector> in, +static arrow::Status EncodeIndices(std::vector> in, std::shared_ptr* out) { arrow::UInt64Builder builder; for (const auto& each : in) {