unikdahal commented on code in PR #5414:
URL: https://github.com/apache/datafusion-comet/pull/5414#discussion_r3836729220


##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -54,8 +54,9 @@ trait DataTypeSupport {
           CalendarIntervalType =>
         true
       case StructType(fields) =>
-        fields.nonEmpty && fields.forall(f =>
-          isTypeSupported(f.dataType, f.name, fallbackReasons))
+        // A struct's `fields` can be empty -- e.g. Iceberg's `_partition` 
metadata column is
+        // exactly that on an unpartitioned table. It's still a value Comet 
can represent.
+        fields.forall(f => isTypeSupported(f.dataType, f.name, 
fallbackReasons))

Review Comment:
   Fixed. `CometFirst`/`CometLast` now decline any schema containing an empty 
struct
   (recursively through struct/array/map, matching where `ScalarValue::compact` 
would panic)
   via a `getSupportLevel` check applies whether First/Last is used as a plain 
aggregate
   or a window function, since both share the same serde. Added a regression 
test
   reproducing your exact repro; confirmed no panic, correct fallback.
   
   Also opened the actual fix upstream: apache/datafusion#24582.



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