QuestionQ130

VerifiedUsing Spark SQL

A data engineering team created a pipeline that extracts data from a transaction system. Because the transaction system stores timestamps in UTC, the data engineers ingested the timestamps into the raw DataFrame in UTC. They must now transform transaction_datetime to the America/New_York time zone to produce accurate reports.

Which code should be used to convert transaction_datetime?

Explanation

from_utc_timestamp interprets the input timestamp as UTC and renders it in the specified target time zone. Supplying America/New_York therefore converts the UTC transaction timestamps to the required reporting time zone.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!