diff options
Diffstat (limited to 'tests/test_transpile.py')
-rw-r--r-- | tests/test_transpile.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_transpile.py b/tests/test_transpile.py index b5e069a..5ea5ffe 100644 --- a/tests/test_transpile.py +++ b/tests/test_transpile.py @@ -561,6 +561,10 @@ FROM x""", AND Z""", """SELECT X FROM catalog.db.table WHERE Y AND Z""", ) + self.validate( + """with a as /* comment */ ( select * from b) select * from a""", + """WITH a AS (SELECT * FROM b) /* comment */ SELECT * FROM a""", + ) def test_types(self): self.validate("INT 1", "CAST(1 AS INT)") @@ -760,7 +764,7 @@ FROM x""", self.validate("STR_TO_TIME('x', 'y')", "DATE_PARSE('x', 'y')", write="presto") self.validate( "STR_TO_UNIX('x', 'y')", - "TO_UNIXTIME(COALESCE(TRY(DATE_PARSE(CAST('x' AS VARCHAR), 'y')), PARSE_DATETIME(CAST('x' AS VARCHAR), 'y')))", + "TO_UNIXTIME(COALESCE(TRY(DATE_PARSE(CAST('x' AS VARCHAR), 'y')), PARSE_DATETIME(DATE_FORMAT(CAST('x' AS TIMESTAMP), 'y'), 'y')))", write="presto", ) self.validate("TIME_TO_STR(x, 'y')", "DATE_FORMAT(x, 'y')", write="presto") |