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



##########
File path: spark/src/main/java/org/apache/iceberg/spark/source/PartitionKey.java
##########
@@ -176,61 +70,22 @@ public int hashCode() {
     }
   }
 
-  private static Accessor<InternalRow> newAccessor(int position, boolean 
isOptional, Types.StructType type,
-                                                   Accessor<InternalRow> 
accessor) {
+  @Override
+  protected Accessor<InternalRow> newAccessor(int position, boolean 
isOptional, Types.StructType type,
+                                              Accessor<InternalRow> accessor) {
     int size = type.fields().size();
     if (isOptional) {
       // the wrapped position handles null layers
       return new WrappedPositionAccessor(position, size, accessor);
     } else if (accessor.getClass() == PositionAccessor.class) {
       return new Position2Accessor(position, size, (PositionAccessor) 
accessor);
-    } else if (accessor instanceof Position2Accessor) {
+    } else if (accessor.getClass() == Position2Accessor.class) {

Review comment:
       It's quite confuse for me to see that the above else-if use 
`accessor.getClass() == PositionAccessor.class` while this line use `accessor 
instanceof Position2Accessor`.  I see that there's only one Position2Accessor 
implementation, so changing it from `instanceof`  to `=` should be OK here.




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