2424#include " gtest/gtest.h"
2525
2626#include < sstream>
27+ #include < arrow/compute/api.h>
2728
2829#include " parquet/api/reader.h"
2930#include " parquet/api/writer.h"
@@ -44,14 +45,16 @@ using arrow::ArrayVisitor;
4445using arrow::Buffer;
4546using arrow::ChunkedArray;
4647using arrow::Column;
47- using arrow::EncodeArrayToDictionary;
4848using arrow::ListArray;
4949using arrow::PoolBuffer;
5050using arrow::PrimitiveArray;
5151using arrow::Status;
5252using arrow::Table;
5353using arrow::TimeUnit;
5454using arrow::default_memory_pool;
55+ using arrow::compute::DictionaryEncode;
56+ using arrow::compute::FunctionContext;
57+ using arrow::compute::Datum;
5558using arrow::io::BufferReader;
5659
5760using arrow::test::randint;
@@ -619,8 +622,10 @@ TYPED_TEST(TestParquetIO, SingleColumnOptionalDictionaryWrite) {
619622
620623 ASSERT_OK (NullableArray<TypeParam>(SMALL_SIZE, 10 , kDefaultSeed , &values));
621624
622- std::shared_ptr<Array> dict_values;
623- ASSERT_OK (EncodeArrayToDictionary (*values, default_memory_pool (), &dict_values));
625+ Datum out;
626+ FunctionContext ctx (default_memory_pool ());
627+ ASSERT_OK (DictionaryEncode (&ctx, Datum (values), &out));
628+ std::shared_ptr<Array> dict_values = MakeArray (out.array ());
624629 std::shared_ptr<GroupNode> schema =
625630 MakeSimpleSchema (*dict_values->type (), Repetition::OPTIONAL);
626631 this ->WriteColumn (schema, dict_values);
0 commit comments