JingsongLi commented on code in PR #8321:
URL: https://github.com/apache/paimon/pull/8321#discussion_r3456894445
##########
paimon-format/src/main/java/org/apache/paimon/format/parquet/writer/ParquetBuilder.java:
##########
@@ -34,4 +36,10 @@ public interface ParquetBuilder<T> extends Serializable {
/** Creates and configures a parquet writer to the given output file. */
ParquetWriter<T> createWriter(OutputFile out, String compression) throws
IOException;
+
+ default ParquetWriter<T> createWriter(
+ OutputFile out, String compression, Supplier<Map<String, byte[]>>
metadataSupplier)
+ throws IOException {
+ return createWriter(out, compression);
Review Comment:
This default makes metadata support silently disappear for any
`ParquetBuilder` implementation that only implements the original two-argument
`createWriter`. `ParquetWriterFactory` still returns a `ParquetBulkWriter` that
implements `SupportsWriterMetadata`, so callers can call `addMetadata(...)`
successfully, but `finalizeWrite()` will never see the map and the footer will
not contain the entries. Please either make support explicit (for example, fail
from this overload unless the builder wires the supplier into
`WriteSupport.finalizeWrite`) or avoid exposing `SupportsWriterMetadata` for
builders that cannot persist it.
--
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]