From 5eb8a9e33f4e322495d600853d7ac4b137294b27 Mon Sep 17 00:00:00 2001 From: tkaunlaky-e6 Date: Mon, 2 Mar 2026 15:00:15 +0530 Subject: [PATCH 1/2] Add EEEE/EEE/EE weekday format mappings to E6 dialect E6 TIME_MAPPING only had 'E' -> '%a' (abbreviated weekday). The full weekday name format 'EEEE' -> '%A' was missing, causing DATE_FORMAT with EEEE to output '%A' literally instead of 'EEEE' in transpiled SQL. --- sqlglot/dialects/e6.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sqlglot/dialects/e6.py b/sqlglot/dialects/e6.py index 039c21f30c..c4f44de5e2 100644 --- a/sqlglot/dialects/e6.py +++ b/sqlglot/dialects/e6.py @@ -472,6 +472,9 @@ class E6(Dialect): "m": "%-M", # Single-digit minute "ss": "%S", # Two-digit second "s": "%-S", # Single-digit second + "EEEE": "%A", # Full weekday name + "EEE": "%a", # Abbreviated weekday name + "EE": "%a", # Abbreviated weekday name "E": "%a", # Abbreviated weekday name "D": "%-j", "DD": "%j", From 5d0f1a98158e14ad617fd048fb88da0ca9d6ce77 Mon Sep 17 00:00:00 2001 From: tkaunlaky-e6 Date: Mon, 2 Mar 2026 15:05:24 +0530 Subject: [PATCH 2/2] Add EEEE/EEE/EE weekday format mappings to E6 dialect E6 TIME_MAPPING only had 'E' -> '%a' (abbreviated weekday). The full weekday name format 'EEEE' -> '%A' was missing, causing DATE_FORMAT with EEEE to output '%A' literally instead of 'EEEE' in transpiled SQL. --- tests/dialects/test_e6.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/dialects/test_e6.py b/tests/dialects/test_e6.py index ce7b41b873..a607880719 100644 --- a/tests/dialects/test_e6.py +++ b/tests/dialects/test_e6.py @@ -2054,6 +2054,20 @@ def test_date_time(self): }, ) + # EEEE (full weekday name) should be preserved in transpilation + self.validate_all( + "SELECT FORMAT_DATE(CAST(CURRENT_TIMESTAMP AS TIMESTAMP), 'dd MMMM, EEEE') AS \"formatted_date\"", + read={ + "databricks": "select DATE_FORMAT(current_timestamp, 'dd MMMM, EEEE') AS `formatted_date`" + }, + ) + + # EEE (abbreviated weekday name) should be preserved + self.validate_all( + "SELECT FORMAT_DATE(CAST(CURRENT_TIMESTAMP AS TIMESTAMP), 'dd MMM, EEE')", + read={"databricks": "select DATE_FORMAT(current_timestamp, 'dd MMM, EEE')"}, + ) + def test_conditional_expression(self): self.validate_all( "SELECT SUM(COALESCE(CASE WHEN performance_rating > 7 THEN 1 END, 0))",