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


##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/example/ExampleParquetWriter.java:
##########
@@ -113,11 +110,6 @@ public Builder withType(MessageType type) {
       return this;
     }
 
-    public Builder withExtraMetaData(Map<String, String> extraMetaData) {

Review Comment:
   Is it possible to add an overload here to suppress the complaint of japicmp? 
That's more preferable than an exclusion.



##########
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 Map<String, String> extraMetadata;
+    if (encodingProps.getExtraMetaData() == null
+        || encodingProps.getExtraMetaData().isEmpty()) {
+      extraMetadata = writeContext.getExtraMetaData();
+    } else {
+      extraMetadata = new HashMap<>(writeContext.getExtraMetaData());
+
+      encodingProps.getExtraMetaData().forEach((metadataKey, metadataValue) -> 
{
+        if (metadataKey.equals(OBJECT_MODEL_NAME_PROP)) {

Review Comment:
   Can we avoid specializing any key? IIUC, it can also be caught at line 422 
if OBJECT_MODEL_NAME_PROP has been set already.



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