diff --git a/cpp/src/parquet/column/column-writer-test.cc b/cpp/src/parquet/column/column-writer-test.cc index 745efe7f11c16..2269e8f736d2c 100644 --- a/cpp/src/parquet/column/column-writer-test.cc +++ b/cpp/src/parquet/column/column-writer-test.cc @@ -381,10 +381,11 @@ TYPED_TEST(TestPrimitiveWriter, RequiredVeryLargeChunk) { writer->WriteBatch(this->values_.size(), nullptr, nullptr, this->values_ptr_); writer->Close(); - // Just read the first SMALL_SIZE rows to ensure we could read it back in - this->ReadColumn(); - ASSERT_EQ(SMALL_SIZE, this->values_read_); - this->values_.resize(SMALL_SIZE); + // Read all rows so we are sure that also the non-dictionary pages are read correctly + this->SetupValuesOut(VERY_LARGE_SIZE); + this->ReadColumnFully(); + ASSERT_EQ(VERY_LARGE_SIZE, this->values_read_); + this->values_.resize(VERY_LARGE_SIZE); ASSERT_EQ(this->values_, this->values_out_); std::vector encodings = this->metadata_encodings(); // There are 3 encodings (RLE, PLAIN_DICTIONARY, PLAIN) in a fallback case diff --git a/cpp/src/parquet/column/writer.cc b/cpp/src/parquet/column/writer.cc index d1c3fe2ca3492..92a5e09968143 100644 --- a/cpp/src/parquet/column/writer.cc +++ b/cpp/src/parquet/column/writer.cc @@ -216,6 +216,7 @@ void TypedColumnWriter::CheckDictionarySizeLimit() { fallback_ = true; // Only PLAIN encoding is supported for fallback in V1 current_encoder_.reset(new PlainEncoder(descr_, properties_->allocator())); + encoding_ = Encoding::PLAIN; } }