pitrou commented on code in PR #41580:
URL: https://github.com/apache/arrow/pull/41580#discussion_r1686205194
##########
cpp/src/parquet/column_writer_test.cc:
##########
@@ -1705,5 +1719,55 @@ TEST(TestColumnWriter, WriteDataPageV2HeaderNullCount) {
}
}
+using TestInt32Writer = TestPrimitiveWriter<Int32Type>;
+
+TEST_F(TestInt32Writer, NoWriteKeyValueMetadata) {
+ auto writer = this->BuildWriter();
+ writer->Close();
+ auto key_value_metadata = metadata_key_value_metadata();
+ ASSERT_THAT(key_value_metadata, IsNull());
+}
+
+TEST_F(TestInt32Writer, WriteKeyValueMetadata) {
+ auto writer = this->BuildWriter();
+ writer->AddKeyValueMetadata(KeyValueMetadata::Make({"hello"}, {"world"}));
+ writer->Close();
+ auto key_value_metadata = metadata_key_value_metadata();
+ ASSERT_THAT(key_value_metadata, NotNull());
+ ASSERT_THAT(key_value_metadata->size(), 1);
+ ASSERT_OK_AND_ASSIGN(auto value, key_value_metadata->Get("hello"));
+ ASSERT_THAT(value, "world");
Review Comment:
I'm ok with `ASSERT_THAT(actual, Eq(expected))`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]