rdblue commented on a change in pull request #830:
URL: https://github.com/apache/iceberg/pull/830#discussion_r441024549
##########
File path:
spark/src/main/java/org/apache/iceberg/spark/source/BatchDataReader.java
##########
@@ -65,8 +68,10 @@
// Spark eagerly consumes the batches. So the underlying memory
allocated could be reused
// without worrying about subsequent reads clobbering over each
other. This improves
// read performance as every batch read doesn't have to pay the cost
of allocating memory.
- .reuseContainers()
- .build();
+ .reuseContainers();
+
+ iter = nameMapping != null ?
+
builder.withNameMapping(NameMappingParser.fromJson(nameMapping)).build() :
builder.build();
Review comment:
I'd prefer to keep the name mapping and building separate. There's no
need to mix these together.
```java
if (nameMapping != null) {
builder.withNameMapping(NameMappingParser.fromJson(nameMapping));
}
iter = builder.build();
```
----------------------------------------------------------------
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]