pvary commented on code in PR #14148:
URL: https://github.com/apache/iceberg/pull/14148#discussion_r2371650226


##########
flink/v2.0/flink/src/test/java/org/apache/iceberg/flink/TestHelpers.java:
##########
@@ -197,21 +208,18 @@ public static void assertRowData(
         LogicalType logicalType = ((RowType) rowType).getTypeAt(pos);
         Object actualValue =
             FlinkRowData.createFieldGetter(logicalType, 
pos).getFieldOrNull(actualRowData);
+        Object expectedValue;
         if (expectedField != null) {
-          assertEquals(
-              field.type(), logicalType, 
expected.getField(expectedField.name()), actualValue);
+          expectedValue = getExpectedValue(idToConstant, rowPosition, 
expectedField, expected);
         } else {
           // convert the initial value to generic because that is the data 
model used to generate
           // the expected records
-          assertEquals(
-              field.type(),
-              logicalType,
-              GenericDataUtil.internalToGeneric(field.type(), 
field.initialDefault()),
-              actualValue);
+          expectedValue = GenericDataUtil.internalToGeneric(field.type(), 
field.initialDefault());
         }

Review Comment:
   Is this easier to read?
   ```
   Object expectedValue =  expectedField != null ?
             getExpectedValue(idToConstant, rowPosition, expectedField, 
expected):
             GenericDataUtil.internalToGeneric(field.type(), 
field.initialDefault());
   ```



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

Reply via email to