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>