Skip to content

Commit

Permalink
PARQUET-760: Store correct encoding in fallback data pages
Browse files Browse the repository at this point in the history
Author: Uwe L. Korn <[email protected]>

Closes apache#182 from xhochy/PARQUET-760 and squashes the following commits:

1791506 [Uwe L. Korn] PARQUET-760: Store correct encoding in fallback data pages

Change-Id: Id8f2308a3c8a9ebacb251476f532b82bba9f2787
  • Loading branch information
xhochy authored and wesm committed Nov 1, 2016
1 parent 3159841 commit e3658a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cpp/src/parquet/column/column-writer-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<Encoding::type> encodings = this->metadata_encodings();
// There are 3 encodings (RLE, PLAIN_DICTIONARY, PLAIN) in a fallback case
Expand Down
1 change: 1 addition & 0 deletions cpp/src/parquet/column/writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ void TypedColumnWriter<Type>::CheckDictionarySizeLimit() {
fallback_ = true;
// Only PLAIN encoding is supported for fallback in V1
current_encoder_.reset(new PlainEncoder<Type>(descr_, properties_->allocator()));
encoding_ = Encoding::PLAIN;
}
}

Expand Down

0 comments on commit e3658a6

Please sign in to comment.