Description
How to reproduce this issue:
select to_utc_timestamp("2020-02-07 16:00:00", "GMT+8:00");
Spark 2.4:
spark-sql> select to_utc_timestamp("2020-02-07 16:00:00", "GMT+8:00"); 2020-02-07 08:00:00 Time taken: 0.089 seconds, Fetched 1 row(s)
Spark 3.x:
spark-sql> select to_utc_timestamp("2020-02-07 16:00:00", "GMT+8:00"); 21/02/07 01:24:32 ERROR SparkSQLDriver: Failed in [select to_utc_timestamp("2020-02-07 16:00:00", "GMT+8:00")] java.time.DateTimeException: Invalid ID for offset-based ZoneId: GMT+8:00 at java.time.ZoneId.ofWithPrefix(ZoneId.java:437) at java.time.ZoneId.of(ZoneId.java:407) at java.time.ZoneId.of(ZoneId.java:359) at java.time.ZoneId.of(ZoneId.java:315) at org.apache.spark.sql.catalyst.util.DateTimeUtils$.getZoneId(DateTimeUtils.scala:53) at org.apache.spark.sql.catalyst.util.DateTimeUtils$.toUTCTime(DateTimeUtils.scala:814)