pitrou commented on code in PR #41580:
URL: https://github.com/apache/arrow/pull/41580#discussion_r1718482728
##########
cpp/src/parquet/metadata.cc:
##########
@@ -135,6 +135,36 @@ std::shared_ptr<Statistics> MakeColumnStats(const
format::ColumnMetaData& meta_d
throw ParquetException("Can't decode page statistics for selected column
type");
}
+template <typename Metadata>
+std::shared_ptr<KeyValueMetadata> CopyKeyValueMetadata(const Metadata& source)
{
Review Comment:
Perhaps call this `FromThriftKeyValueMetadata`?
##########
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"}));
Review Comment:
Can you add a test where `AddKeyValueMetadata` is called twice?
--
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]