[SPARK-54463][SQL] Add CSV serialization and deserialization support for TIME type #53175
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.
What changes were proposed in this pull request?
This PR adds CSV serialization and deserialization support for Spark's TIME type
Why are the changes needed?
TIME type currently lacks CSV support, preventing users from:
from_csv()andto_csv()functions with TIME typeDoes this PR introduce any user-facing change?
Yes.
Users can now:
spark.read.schema("time TIME(6)").csv("data.csv")df.write.csv("output.csv")→14:30:45.123456spark.read.option("timeFormat", "HH-mm-ss.SSSSSS").csv("data.csv")timeFormat- controls TIME formatting/parsing (default:HH:mm:sswith fractional seconds)How was this patch tested?
Added new test cases in
CsvExpressionsSuite,CsvFunctionsSuite, SQL tests (csv-functions.sql), andCsvSuiteWas this patch authored or co-authored using generative AI tooling?
Yes.
Generated-by: Claude 3.5 Sonnet
AI assistance was used for: