aokolnychyi commented on a change in pull request #2984:
URL: https://github.com/apache/iceberg/pull/2984#discussion_r716847785
##########
File path: api/src/main/java/org/apache/iceberg/util/StructProjection.java
##########
@@ -134,11 +156,17 @@ public int size() {
@Override
public <T> T get(int pos, Class<T> javaClass) {
+ int structPos = positionMap[pos];
+
if (nestedProjections[pos] != null) {
- return
javaClass.cast(nestedProjections[pos].wrap(struct.get(positionMap[pos],
StructLike.class)));
+ return javaClass.cast(nestedProjections[pos].wrap(struct.get(structPos,
StructLike.class)));
}
- return struct.get(positionMap[pos], javaClass);
+ if (structPos != -1) {
+ return struct.get(structPos, javaClass);
+ } else {
+ return null;
Review comment:
I think it is actually always null as long as the field was not found.
I'll add an explicit call, though.
--
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]