summaryrefslogtreecommitdiffstats
path: root/tests/test_transpile.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_transpile.py')
-rw-r--r--tests/test_transpile.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/test_transpile.py b/tests/test_transpile.py
index d68f6f8..ad8ec72 100644
--- a/tests/test_transpile.py
+++ b/tests/test_transpile.py
@@ -263,6 +263,18 @@ FROM v""",
"(/* 1 */ 1 ) /* 2 */",
"(1) /* 1 */ /* 2 */",
)
+ self.validate(
+ "select * from t where not a in (23) /*test*/ and b in (14)",
+ "SELECT * FROM t WHERE NOT a IN (23) /* test */ AND b IN (14)",
+ )
+ self.validate(
+ "select * from t where a in (23) /*test*/ and b in (14)",
+ "SELECT * FROM t WHERE a IN (23) /* test */ AND b IN (14)",
+ )
+ self.validate(
+ "select * from t where ((condition = 1)/*test*/)",
+ "SELECT * FROM t WHERE ((condition = 1) /* test */)",
+ )
def test_types(self):
self.validate("INT 1", "CAST(1 AS INT)")
@@ -324,9 +336,6 @@ FROM v""",
)
self.validate("SELECT IF(a > 1, 1) FROM foo", "SELECT CASE WHEN a > 1 THEN 1 END FROM foo")
- def test_ignore_nulls(self):
- self.validate("SELECT COUNT(x RESPECT NULLS)", "SELECT COUNT(x)")
-
def test_with(self):
self.validate(
"WITH a AS (SELECT 1) WITH b AS (SELECT 2) SELECT *",
@@ -482,7 +491,7 @@ FROM v""",
self.validate("UNIX_TO_STR(123, 'y')", "FROM_UNIXTIME(123, 'y')", write="spark")
self.validate(
"UNIX_TO_TIME(123)",
- "FROM_UNIXTIME(123)",
+ "CAST(FROM_UNIXTIME(123) AS TIMESTAMP)",
write="spark",
)
self.validate(