Skip to content

Commit fc00fb4

Browse files
Add: Cast TIMESTAMP_NTZ to BIGINT in Spark
Closes #240
1 parent d339356 commit fc00fb4

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
id: c2c5634e36
3+
question: Why does casting TIMESTAMP_NTZ to BIGINT fail in Spark, and how can I convert
4+
it to a numeric value?
5+
sort_order: 63
6+
---
7+
8+
TIMESTAMP_NTZ cannot be cast directly to numeric types like BIGINT in Spark. To convert to a numeric representation (epoch seconds), use the to_unix_timestamp function.
9+
10+
```sql
11+
SELECT to_unix_timestamp(tpep_pickup_datetime)
12+
FROM yellow_2025_11
13+
```

0 commit comments

Comments
 (0)