clairemcginty commented on code in PR #1241:
URL: https://github.com/apache/parquet-mr/pull/1241#discussion_r1438342596


##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetWriter.java:
##########
@@ -403,15 +405,29 @@ public ParquetWriter(Path file, Configuration conf, 
WriteSupport<T> writeSupport
 
     this.codecFactory = codecFactory;
     CompressionCodecFactory.BytesInputCompressor compressor = 
codecFactory.getCompressor(compressionCodecName);
+
+    final String extraMetadataConfPrefix = 
ParquetOutputFormat.EXTRA_WRITE_METADATA + ".";
+    final Map<String, String> extraMetadata = new 
HashMap<>(writeContext.getExtraMetaData());
+
+    conf.iterator().forEachRemaining(entry -> {

Review Comment:
   👍 
   
   Do you think it still makes sense to implement this functionality both as a 
new `ParquetWriter` constructor arg, *and* as a Configuration option that gets 
parsed during construction? Like if we add this new constructor overload:
   
   ```diff
   ParquetWriter(
         OutputFile file,
         ParquetFileWriter.Mode mode,
         WriteSupport<T> writeSupport,
         CompressionCodecName compressionCodecName,
         long rowGroupSize,
         boolean validating,
         ParquetConfiguration conf,
         int maxPaddingSize,
         ParquetProperties encodingProps,
         FileEncryptionProperties encryptionProperties,
   +     Map<String, String> extraMetadata)
   ```
   It might be redundant/confusing to also iterate over `conf` for all keys 
starting with `parquet.write.metadata.extra`. Maybe we should just add it as a 
constructor arg and drop the Configuration key/parsing altogether. Wdyt?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to