Amol Aggarwal
Amol Aggarwal

Reputation: 2824

Timestamp comparison in spark sql

I have below query in spark sql

sparkSession.sql(f"( SELECT * FROM {ordersTable} \
                    WHERE lastUpdated >= current_timestamp() - INTERVAL 24 hours)")

The date-time in lastUpdated is stored in UTC format eg 2023-09-14T22:47:42.187Z. I know that the current_timestamp() gives the local date-time on the server where the code is running but will the current_timestamp be automatically converted to UTC format for the purpose of comparison here?

Upvotes: 0

Views: 296

Answers (0)

Related Questions