pvary commented on code in PR #14297:
URL: https://github.com/apache/iceberg/pull/14297#discussion_r3093477306
##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetFormatModel.java:
##########
@@ -179,12 +216,16 @@ public ModelWriteBuilder<D, S> withAADPrefix(ByteBuffer
aadPrefix) {
@Override
public FileAppender<D> build() throws IOException {
+ Preconditions.checkState(content != null, "File content type must be set
before building");
switch (content) {
case DATA:
internal.createContextFunc(Parquet.WriteBuilder.Context::dataContext);
internal.createWriterFunc(
(icebergSchema, messageType) ->
writerFunction.write(icebergSchema, messageType,
engineSchema));
+ if (shreddingEnabled && variantAnalyzer != null &&
hasVariantColumns(schema)) {
+ return buildShreddedAppender();
Review Comment:
I don't really like this `return` here.
Could we just create a boolean flag and do this next to the other `return`
and wrap the result of the `internal.build()` if needed?
--
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]