Skip to content

Commit 39953ed

Browse files
committed
fix: Make cast string to timestamp compatible with Spark
Add addtional formats and handle edge cases. Update compatibility guide
1 parent c3f59a6 commit 39953ed

5 files changed

Lines changed: 691 additions & 78 deletions

File tree

docs/source/user-guide/latest/compatibility.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ Cast operations in Comet fall into three levels of support:
149149
Spark.
150150
- **N/A**: Spark does not support this cast.
151151

152+
### String to Timestamp
153+
154+
Comet's native `CAST(string AS TIMESTAMP)` implementation supports all timestamp formats accepted
155+
by Apache Spark, including ISO 8601 date-time strings, date-only strings, time-only strings
156+
(`HH:MM:SS`), embedded timezone offsets (e.g. `+07:30`, `GMT-01:00`, `UTC`), named timezone
157+
suffixes (e.g. `Europe/Moscow`), and the full Spark timestamp year range
158+
(-290308 to 294247). Note that `CAST(string AS DATE)` is only compatible for years between
159+
262143 BC and 262142 AD due to an underlying library limitation.
160+
152161
### Legacy Mode
153162

154163
<!--BEGIN:CAST_LEGACY_TABLE-->

0 commit comments

Comments
 (0)