Repository: tobymao/sqlglot

Issue:
Incorrect format option for DATE_FORMAT when transpiling from Spark to Presto
The following Spark query:
```
select time, date_format(time, 'EEEE') as weekday
from table
```
is transpiled to this Presto query:
```
SELECT time, DATE_FORMAT(CAST(time AS TIMESTAMP), '%A') AS weekday 
FROM table
```
but the `%A` option should be `%W` ([Presto doc](https://prestodb.io/docs/current/functions/datetime.html)). `%A` is not a valid format and will return `A`.


Discussion:

Patch:
diff --git a/sqlglot/dialects/presto.py b/sqlglot/dialects/presto.py
index c44976be..12469808 100644
--- a/sqlglot/dialects/presto.py
+++ b/sqlglot/dialects/presto.py
@@ -245,13 +245,17 @@ class Presto(Dialect):
     INDEX_OFFSET = 1
     NULL_ORDERING = "nulls_are_last"
     TIME_FORMAT = MySQL.TIME_FORMAT
-    TIME_MAPPING = MySQL.TIME_MAPPING
     STRICT_STRING_CONCAT = True
     SUPPORTS_SEMI_ANTI_JOIN = False
     TYPED_DIVISION = True
     TABLESAMPLE_SIZE_IS_PERCENT = True
     LOG_BASE_FIRST: t.Optional[bool] = None
 
+    TIME_MAPPING = {
+        **MySQL.TIME_MAPPING,
+        "%W": "%A",
+    }
+
     # https://github.com/trinodb/trino/issues/17
     # https://github.com/trinodb/trino/issues/12289
     # https://github.com/prestodb/presto/issues/2863


Test patch:
diff --git a/tests/dialects/test_spark.py b/tests/dialects/test_spark.py
index fc3146f6..9d761e94 100644
--- a/tests/dialects/test_spark.py
+++ b/tests/dialects/test_spark.py
@@ -297,6 +297,13 @@ TBLPROPERTIES (
                 },
             )
 
+        self.validate_all(
+            "SELECT DATE_FORMAT(DATE '2020-01-01', 'EEEE') AS weekday",
+            write={
+                "presto": "SELECT DATE_FORMAT(CAST(CAST('2020-01-01' AS DATE) AS TIMESTAMP), '%W') AS weekday",
+                "spark": "SELECT DATE_FORMAT(CAST(CAST('2020-01-01' AS DATE) AS TIMESTAMP), 'EEEE') AS weekday",
+            },
+        )
         self.validate_all(
             "SELECT TRY_ELEMENT_AT(MAP(1, 'a', 2, 'b'), 2)",
             read={