From e8eff81580259ab215ba79c90181f7d4d408d5b7 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Wed, 21 Sep 2016 23:50:27 -0400 Subject: [PATCH] PARQUET-724: Test more advanced properties setting Author: Uwe L. Korn Closes #166 from xhochy/parquet-724 and squashes the following commits: 8b32f5f [Uwe L. Korn] PARQUET-724: Test more advanced properties setting Change-Id: I6fdbd9218d8cccb789a3bbf714af3fc9a6d51211 --- cpp/src/parquet/column/properties-test.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cpp/src/parquet/column/properties-test.cc b/cpp/src/parquet/column/properties-test.cc index 0d7314badabbc..07247cf95536d 100644 --- a/cpp/src/parquet/column/properties-test.cc +++ b/cpp/src/parquet/column/properties-test.cc @@ -24,6 +24,8 @@ namespace parquet { +using schema::ColumnPath; + namespace test { TEST(TestReaderProperties, Basics) { @@ -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 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