clairemcginty commented on code in PR #1241:
URL: https://github.com/apache/parquet-mr/pull/1241#discussion_r1452398742
##########
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:
This key is kind of a special case since it's added by the delegated
`InternalParqueRecordWriter` at the end of writing:
https://github.com/apache/parquet-mr/blob/945836c/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordWriter.java#L132-L134
So if we remove this extra check and there's a conflicting
`OBJECT_MODEL_NAME_PROP` key in `extraMetaData`, `InternalParquetRecordWriter`
will silently overwrite it at the end.
--
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]