mohitgurav20 opened a new pull request, #6324:
URL: https://github.com/apache/datafusion-comet/pull/6324

   ## Which issue does this PR close?
   Closes #6251 
   
   ## Rationale for this change
   As reported in #6251, `arrays_zip` natively fails the task with a 
`java.lang.IllegalStateException: ArrowArray struct has 2 children (expected 
1)` when two input struct fields have the same name (e.g. `arrays_zip(a, a)`). 
This occurs because Java Arrow's `ArrayImporter` indexes struct children by 
field name during JVM vector import, causing duplicate names to collapse. 
   
   ## What changes are included in this PR?
   Following the established pattern in `CometCreateNamedStruct`, this updates 
`CometArraysZip.getSupportLevel` to explicitly evaluate `expr.names`. If it 
detects duplicate field names, it returns `Unsupported`. This allows Comet to 
gracefully fall back to the Spark JVM evaluation for these queries, avoiding 
the task failure. 
   
   I've also added a corresponding test case in `CometExpressionSuite` to 
ensure that duplicate field names properly evaluate without crashing.
   
   ## How are these changes tested?
   - Added `arrays_zip with duplicate field names falls back to Spark` test in 
`CometExpressionSuite`
   - Existing tests and suites
   


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