You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/01/19 21:29:07 UTC

[GitHub] [iceberg] Fokko commented on a change in pull request #2114: Spark: Replace spec.fields().isEmpty() to isUnpartitioned()

Fokko commented on a change in pull request #2114:
URL: https://github.com/apache/iceberg/pull/2114#discussion_r560508335



##########
File path: spark/src/main/java/org/apache/iceberg/spark/source/RowDataRewriter.java
##########
@@ -103,8 +103,8 @@ public RowDataRewriter(Table table, PartitionSpec spec, boolean caseSensitive,
     OutputFileFactory fileFactory = new OutputFileFactory(
         spec, format, locations, io.value(), encryptionManager.value(), partitionId, taskId);
 
-    TaskWriter<InternalRow> writer;
-    if (spec.fields().isEmpty()) {
+    final TaskWriter<InternalRow> writer;

Review comment:
       This is mostly for my IDE and sanity. I'm not very puristic about the final usage, but in this case, I think it really adds value. If the if/else construction changes below, and it won't be assigned, it will give an explicit error.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org