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

Commit

Permalink
Fix reader writer test for unique kernel addition
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Nov 19, 2017
1 parent da0a7eb commit e25c59b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/parquet/arrow/arrow-reader-writer-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "gtest/gtest.h"

#include <sstream>
#include <arrow/compute/api.h>

#include "parquet/api/reader.h"
#include "parquet/api/writer.h"
Expand All @@ -44,14 +45,16 @@ using arrow::ArrayVisitor;
using arrow::Buffer;
using arrow::ChunkedArray;
using arrow::Column;
using arrow::EncodeArrayToDictionary;
using arrow::ListArray;
using arrow::PoolBuffer;
using arrow::PrimitiveArray;
using arrow::Status;
using arrow::Table;
using arrow::TimeUnit;
using arrow::default_memory_pool;
using arrow::compute::DictionaryEncode;
using arrow::compute::FunctionContext;
using arrow::compute::Datum;
using arrow::io::BufferReader;

using arrow::test::randint;
Expand Down Expand Up @@ -619,8 +622,10 @@ TYPED_TEST(TestParquetIO, SingleColumnOptionalDictionaryWrite) {

ASSERT_OK(NullableArray<TypeParam>(SMALL_SIZE, 10, kDefaultSeed, &values));

std::shared_ptr<Array> dict_values;
ASSERT_OK(EncodeArrayToDictionary(*values, default_memory_pool(), &dict_values));
Datum out;
FunctionContext ctx(default_memory_pool());
ASSERT_OK(DictionaryEncode(&ctx, Datum(values), &out));
std::shared_ptr<Array> dict_values = MakeArray(out.array());
std::shared_ptr<GroupNode> schema =
MakeSimpleSchema(*dict_values->type(), Repetition::OPTIONAL);
this->WriteColumn(schema, dict_values);
Expand Down

0 comments on commit e25c59b

Please sign in to comment.