Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit e25c59b

Browse files
committed
Fix reader writer test for unique kernel addition
1 parent da0a7eb commit e25c59b

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/parquet/arrow/arrow-reader-writer-test.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
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;
4445
using arrow::Buffer;
4546
using arrow::ChunkedArray;
4647
using arrow::Column;
47-
using arrow::EncodeArrayToDictionary;
4848
using arrow::ListArray;
4949
using arrow::PoolBuffer;
5050
using arrow::PrimitiveArray;
5151
using arrow::Status;
5252
using arrow::Table;
5353
using arrow::TimeUnit;
5454
using arrow::default_memory_pool;
55+
using arrow::compute::DictionaryEncode;
56+
using arrow::compute::FunctionContext;
57+
using arrow::compute::Datum;
5558
using arrow::io::BufferReader;
5659

5760
using 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

Comments
 (0)