Skip to content

Commit

Permalink
PARQUET-724: Test more advanced properties setting
Browse files Browse the repository at this point in the history
Author: Uwe L. Korn <uwelk@xhochy.com>

Closes apache#166 from xhochy/parquet-724 and squashes the following commits:

8b32f5f [Uwe L. Korn] PARQUET-724: Test more advanced properties setting

Change-Id: I6fdbd9218d8cccb789a3bbf714af3fc9a6d51211
  • Loading branch information
xhochy authored and wesm committed Sep 22, 2016
1 parent cf93990 commit 53ea805
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cpp/src/parquet/column/properties-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

namespace parquet {

using schema::ColumnPath;

namespace test {

TEST(TestReaderProperties, Basics) {
Expand All @@ -41,5 +43,22 @@ TEST(TestWriterProperties, Basics) {
ASSERT_EQ(DEFAULT_WRITER_VERSION, props->version());
}

TEST(TestWriterProperties, AdvancedHandling) {
WriterProperties::Builder builder;
builder.compression("gzip", Compression::GZIP);
builder.compression(Compression::SNAPPY);
builder.encoding(Encoding::DELTA_BINARY_PACKED);
builder.encoding("delta-length", Encoding::DELTA_LENGTH_BYTE_ARRAY);
std::shared_ptr<WriterProperties> props = builder.build();

ASSERT_EQ(Compression::GZIP, props->compression(ColumnPath::FromDotString("gzip")));
ASSERT_EQ(
Compression::SNAPPY, props->compression(ColumnPath::FromDotString("delta-length")));
ASSERT_EQ(
Encoding::DELTA_BINARY_PACKED, props->encoding(ColumnPath::FromDotString("gzip")));
ASSERT_EQ(Encoding::DELTA_LENGTH_BYTE_ARRAY,
props->encoding(ColumnPath::FromDotString("delta-length")));
}

} // namespace test
} // namespace parquet

0 comments on commit 53ea805

Please sign in to comment.