exceptionfactory commented on code in PR #11387:
URL: https://github.com/apache/nifi/pull/11387#discussion_r3561453277


##########
nifi-extension-bundles/nifi-iceberg-bundle/nifi-iceberg-processors/src/test/java/org/apache/nifi/processors/iceberg/record/DelegatedRecordTest.java:
##########
@@ -135,4 +139,88 @@ void testGetTimestampDateTimeFields() {
         final Object stopped = delegatedRecord.getField(STOPPED_FIELD);
         assertEquals(STOPPED_CONVERTED, stopped);
     }
+
+    /**
+     * Iceberg writers read values positionally against the table struct, so 
position 0 must always return the value of
+     * the table's first column ("id"), independent of the field ordering in 
the incoming Record schema.
+     */
+    @Test
+    void testGetByPositionMatchesTableColumnNameRegardlessOfInputOrder() {
+        final Types.StructType structType = Types.StructType.of(
+                Types.NestedField.required(1, "id", Types.IntegerType.get()),
+                Types.NestedField.optional(2, "amount", 
Types.DecimalType.of(10, 2)),
+                Types.NestedField.optional(3, "label", Types.StringType.get())
+        );

Review Comment:
   There are some existing static field names and types in the test class that 
can be used. Additional field names and types should be declared statically and 
reused.



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

Reply via email to