Skip to content

Commit

Permalink
PARQUET-703: Validate that ColumnChunk metadata counts nulls in num_v…
Browse files Browse the repository at this point in the history
…alues

Closes apache#145 (this bug was fixed as part of other recent patches)

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes apache#152 from wesm/PARQUET-703 and squashes the following commits:

232d2f1 [Wes McKinney] Validate that ColumnChunk metadata has the number of values set including nulls

Change-Id: I6f7ac294fe19fb311a4f7457b1216887b4326034
  • Loading branch information
wesm authored and xhochy committed Sep 6, 2016
1 parent 19fba81 commit 1db05b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cpp/src/parquet/column/column-writer-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ class TestPrimitiveWriter : public ::testing::Test {
ASSERT_EQ(this->values_, this->values_out_);
}

int64_t metadata_num_values() const {
return metadata_.meta_data.num_values;
}

protected:
int64_t values_read_;
// Keep the reader alive as for ByteArray the lifetime of the ByteArray
Expand Down Expand Up @@ -247,6 +251,9 @@ TYPED_TEST(TestPrimitiveWriter, Optional) {
this->values_.size(), definition_levels.data(), nullptr, this->values_ptr_);
writer->Close();

// PARQUET-703
ASSERT_EQ(100, this->metadata_num_values());

this->ReadColumn();
ASSERT_EQ(99, this->values_read_);
this->values_out_.resize(99);
Expand Down

0 comments on commit 1db05b2

Please sign in to comment.