Brijesh-Thakkar commented on code in PR #2989: URL: https://github.com/apache/datafusion-comet/pull/2989#discussion_r2648683074
########## docs/source/user-guide/latest/compatibility.md: ########## @@ -192,3 +192,47 @@ or strings containing null bytes (e.g \\u0000) | Any cast not listed in the previous tables is currently unsupported. We are working on adding more. See the [tracking issue](https://github.com/apache/datafusion-comet/issues/286) for more details. + +### Complex Type Casts + +In addition to primitive types, Comet provides native support for a limited set +of cast operations involving complex types. This section documents the currently +supported complex type casts and known limitations. + +#### Struct Type Casting + +- `STRUCT` → `STRING` + Casting a struct to a string is supported and produces a string representation + of the struct contents. This includes named structs and nested structs. + + Example: + ```sql + SELECT CAST(named_struct('a', 1, 'b', 'x') AS STRING); + ``` + +- `STRUCT` → `STRUCT` + Casting between struct types is supported when the number of fields matches. + Fields are matched by position rather than by name, consistent with Apache Spark + behavior. + + Example: + ```sql + SELECT CAST(s AS struct<field1:string, field2:string>) FROM table; Review Comment: Done -- 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]
