openinx commented on a change in pull request #1774:
URL: https://github.com/apache/iceberg/pull/1774#discussion_r530214200



##########
File path: 
spark/src/main/java/org/apache/iceberg/spark/source/RowDataRewriter.java
##########
@@ -106,8 +107,17 @@ public RowDataRewriter(Table table, PartitionSpec spec, 
boolean caseSensitive,
     if (spec.fields().isEmpty()) {
       writer = new UnpartitionedWriter<>(spec, format, appenderFactory, 
fileFactory, io.value(), Long.MAX_VALUE);
     } else {
-      writer = new SparkPartitionedWriter(spec, format, appenderFactory, 
fileFactory, io.value(), Long.MAX_VALUE,
-          schema, structType);
+      if (PropertyUtil.propertyAsBoolean(properties,
+          TableProperties.WRITE_PARTITIONED_FANOUT_ENABLED,
+          TableProperties.WRITE_PARTITIONED_FANOUT_ENABLED_DEFAULT)) {
+        writer = new SparkPartitionedFanoutWriter(spec, format, 
appenderFactory, fileFactory, io.value(),
+            Long.MAX_VALUE,

Review comment:
       nit:  don't need to break into a new line here 

##########
File path: 
spark/src/main/java/org/apache/iceberg/spark/source/RowDataRewriter.java
##########
@@ -106,8 +107,17 @@ public RowDataRewriter(Table table, PartitionSpec spec, 
boolean caseSensitive,
     if (spec.fields().isEmpty()) {
       writer = new UnpartitionedWriter<>(spec, format, appenderFactory, 
fileFactory, io.value(), Long.MAX_VALUE);
     } else {
-      writer = new SparkPartitionedWriter(spec, format, appenderFactory, 
fileFactory, io.value(), Long.MAX_VALUE,
-          schema, structType);
+      if (PropertyUtil.propertyAsBoolean(properties,
+          TableProperties.WRITE_PARTITIONED_FANOUT_ENABLED,
+          TableProperties.WRITE_PARTITIONED_FANOUT_ENABLED_DEFAULT)) {
+        writer = new SparkPartitionedFanoutWriter(spec, format, 
appenderFactory, fileFactory, io.value(),
+            Long.MAX_VALUE,
+            schema, structType);
+      } else {
+        writer = new SparkPartitionedWriter(spec, format, appenderFactory, 
fileFactory, io.value(),
+            Long.MAX_VALUE,

Review comment:
       ditto.




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

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