kumarUjjawal commented on code in PR #25023:
URL: https://github.com/apache/datafusion/pull/25023#discussion_r3950569235


##########
datafusion/common/src/nested_struct.rs:
##########
@@ -1551,6 +1553,46 @@ mod tests {
         assert!(result.is_ok());
     }
 
+    #[test]
+    fn test_validate_struct_compatibility_empty_source_and_target() {

Review Comment:
   This test only verifies validation. After validation succeeds, 
`cast_struct_column` still calls `StructArray::try_new` with empty `fields` and 
`arrays`, which Arrow rejects because it cannot infer the row count. I 
reproduced this with a two row `StructArray::new_empty_fields(2, None)`. 
   
   Please use `try_new_with_length` or `new_empty_fields` and add a 
`cast_column` regression that verifies the output length and null validity. 
Otherwise, the reported Iceberg query moves past planning but still fails 
during execution.



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