From 37b129332bf4f37bc4e011d3d6de19a7313e4e58 Mon Sep 17 00:00:00 2001 From: JiaKe Date: Tue, 6 Apr 2021 20:32:10 +0800 Subject: [PATCH] [NSE-229] Fix the deprecated code warning in shuffle_split_test (#230) * fix the deprecated code warning in shuffle_split_test * fix the code style * format update --- native-sql-engine/cpp/src/tests/shuffle_split_test.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/native-sql-engine/cpp/src/tests/shuffle_split_test.cc b/native-sql-engine/cpp/src/tests/shuffle_split_test.cc index 42e86b42b..60c34badc 100644 --- a/native-sql-engine/cpp/src/tests/shuffle_split_test.cc +++ b/native-sql-engine/cpp/src/tests/shuffle_split_test.cc @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -123,10 +124,11 @@ class SplitterTest : public ::testing::Test { auto cntx = arrow::compute::ExecContext(); std::shared_ptr res; - auto maybe_res = arrow::compute::Take(*input_batch, *take_idx, - arrow::compute::TakeOptions{}, &cntx); - res = *std::move(maybe_res); - return res; + ARROW_ASSIGN_OR_RAISE( + arrow::Datum result, + arrow::compute::Take(arrow::Datum(input_batch), arrow::Datum(take_idx), + arrow::compute::TakeOptions{}, &cntx)); + return result.record_batch(); } arrow::Result>