rdblue commented on a change in pull request #1320:
URL: https://github.com/apache/iceberg/pull/1320#discussion_r469509682



##########
File path: flink/src/main/java/org/apache/iceberg/flink/RowDataWrapper.java
##########
@@ -85,52 +85,51 @@ public int size() {
   }
 
   private static PositionalGetter<?> buildGetter(LogicalType logicalType, Type 
type) {
-    switch (type.typeId()) {
-      case STRING:
+    switch (logicalType.getTypeRoot()) {
+      case TINYINT:
+        return (row, pos) -> (int) row.getByte(pos);
+      case SMALLINT:
+        return (row, pos) -> (int) row.getShort(pos);
+      case CHAR:
+      case VARCHAR:
         return (row, pos) -> row.getString(pos).toString();
 
-      case FIXED:
       case BINARY:
-        return (row, pos) -> ByteBuffer.wrap(row.getBinary(pos));
-
-      case UUID:
-        return (row, pos) -> {
-          ByteBuffer bb = ByteBuffer.wrap(row.getBinary(pos));
-          long mostSigBits = bb.getLong();
-          long leastSigBits = bb.getLong();
-          return new UUID(mostSigBits, leastSigBits);
-        };
+      case VARBINARY:
+        if (Type.TypeID.UUID.equals(type.typeId())) {

Review comment:
       I think an identity check would be okay since this is an enum symbol, 
but either way is fine.




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