= current_timestamp() - INTERVAL 24 hours)") The" /> = current_timestamp() - INTERVAL 24 hours)") The" /> = current_timestamp() - INTERVAL 24 hours)") The"/>

Timestamp comparison in spark sql

81 Views Asked by At

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?

0

There are 0 best solutions below