docs: add documentation for complex type cast support #2990
+87
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Description
Which issue does this PR close?
Closes #2743
Rationale for this change
Comet already provides native support for a subset of cast operations involving complex types such as STRUCT and ARRAY, but this behavior was not documented in the compatibility guide. As a result, users may be unaware of which complex type casts are supported natively and which may fall back to Spark.
This change improves the accuracy and completeness of the documentation by explicitly describing the currently supported complex type casts and their limitations, based on existing behavior and tests.
What changes are included in this PR?
STRUCT→STRING(including named structs, nested structs, and structs containing primitive, decimal, date, and timestamp fields)STRUCT→STRUCT(field matching by position)ARRAY<T>→STRING(for element types: boolean, byte, short, integer, long, string, decimal)BINARY→STRING(for valid UTF-8 data)STRING→BINARYHow are these changes tested?
This PR only updates documentation. The documented behavior is verified against existing tests in
CometCastSuite.scala, which cover the supported complex type cast operations:test("cast StructType to StringType")- lines 1090-1110test("cast StructType to StructType")- lines 1112-1123test("cast StructType to StructType with different names")- lines 1125-1141test("cast ArrayType to StringType")- lines 1164-1184test("cast BinaryType to StringType")- lines 895-897test("cast StringType to BinaryType")- lines 847-849No new tests are required for this documentation-only change.