Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
id: c2c5634e36
question: Why does casting TIMESTAMP_NTZ to BIGINT fail in Spark, and how can I convert
it to a numeric value?
sort_order: 62
---

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.

```sql
SELECT to_unix_timestamp(tpep_pickup_datetime)
FROM yellow_2025_11
```