ahmedabu98 commented on code in PR #39645:
URL: https://github.com/apache/beam/pull/39645#discussion_r3724548299
##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/RecordWriter.java:
##########
@@ -104,17 +91,14 @@ class RecordWriter {
.build();
break;
case PARQUET:
- Parquet.DataWriteBuilder parquetBuilder =
+ icebergDataWriter =
Parquet.writeData(outputFile)
.forTable(table)
.createWriterFunc(GenericParquetWriter::create)
.withPartition(partitionKey)
.withKeyMetadata(keyMetadata)
- .overwrite();
- if (writeProperties != null && !writeProperties.isEmpty()) {
- parquetBuilder.setAll(writeProperties);
- }
- icebergDataWriter = parquetBuilder.build();
Review Comment:
Removing this makes writeProperties a no-op if the table already exists
##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/RecordWriterManager.java:
##########
@@ -311,8 +310,11 @@ private Table loadOrCreateTable(IcebergDestination
destination, Schema dataSchem
SortOrder sortOrder = createConfig != null ? createConfig.getSortOrder() :
SortOrder.unsorted();
Map<String, String> tableProperties =
createConfig != null && createConfig.getTableProperties() != null
- ? createConfig.getTableProperties()
+ ? Maps.newHashMap(createConfig.getTableProperties())
: Maps.newHashMap();
+ if (writeProperties != null) {
+ tableProperties.putAll(writeProperties);
+ }
Review Comment:
writeProperties are supposed to be execution-scoped. They're not meant to be
persisted in the actual table's properties
--
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]