SoAnd I have pyspark DF such as:need to extract from utc_timestamp its date and its hour into two different columns depending on time zone. Time zone name is defined by id from configuration const variable.
Input DF Output DF
+-------------+--+
|utc_timestamp|id|
+-------------+--+
|1608000000782|1 |
+-----------+--+--+
|1608000240782|2|utc_timestamp|id| | |utc_timestamp|id|date |hour|
+-------------+--+
And I need to extract from utc_timestamp its date and its hour into two different columns depending on time zone. Time zone name is defined by id from configuration const variable.
So the output should look like this:
+-------------+--+----------+----+|
|utc_timestamp|id|date|1608000000782|1 | |hour| |1608000000782|1 |2020-12-14|20 |
+-------------+--+- +---------+----|
|1608000000782|1 |2020+-12-14|20 |
+----------+----+
|1608000240782|2 | |1608000240782|2 |2020-12-15|11 |
+----------+----+
|1608000240782|2 |2020-12-15|11+ |
+-------------+--+----------+----+