Skip to content

Commit af117c7

Browse files
committed
add back doc
1 parent 09c6471 commit af117c7

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • docs/source/user-guide/latest/compatibility/expressions

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ suffixes (e.g. `Europe/Moscow`), and the full Spark timestamp year range
5858
(-290308 to 294247). Note that `CAST(string AS DATE)` is only compatible for years between
5959
262143 BC and 262142 AD due to an underlying library limitation.
6060

61+
## String to TimestampNTZ
62+
63+
Comet's native `CAST(string AS TIMESTAMP_NTZ)` implementation matches Apache Spark's behavior.
64+
Unlike `CAST(string AS TIMESTAMP)`, this cast is timezone-independent: any timezone offset in
65+
the input string (e.g. `+08:00`, `Z`, `UTC`) is silently discarded, and the local date-time
66+
components are preserved as-is. Time-only strings (e.g. `T12:34:56`, `12:34`) produce `NULL`.
67+
The result is always a wall-clock timestamp with no timezone conversion or DST adjustment.
68+
6169
## Decimal with Negative Scale to String
6270

6371
Casting a `DecimalType` with a negative scale to `StringType` is marked as incompatible when

0 commit comments

Comments
 (0)