summaryrefslogtreecommitdiffstats
path: root/tests/dialects
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 08:03:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 08:03:58 +0000
commit9f19773cebdc9476f2a3266d3c01c967c38fcd1e (patch)
treea60f607ba2bb64fb45da86c297ff29ffc9b92f58 /tests/dialects
parentReleasing debian version 16.7.3-1. (diff)
downloadsqlglot-9f19773cebdc9476f2a3266d3c01c967c38fcd1e.tar.xz
sqlglot-9f19773cebdc9476f2a3266d3c01c967c38fcd1e.zip
Merging upstream version 16.7.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects')
-rw-r--r--tests/dialects/test_bigquery.py2
-rw-r--r--tests/dialects/test_snowflake.py12
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/dialects/test_bigquery.py b/tests/dialects/test_bigquery.py
index e95ff3e..e3fc495 100644
--- a/tests/dialects/test_bigquery.py
+++ b/tests/dialects/test_bigquery.py
@@ -29,6 +29,8 @@ class TestBigQuery(Validator):
with self.assertRaises(ParseError):
transpile("SELECT * FROM UNNEST(x) AS x(y)", read="bigquery")
+ self.validate_identity("SELECT ANY_VALUE(fruit HAVING MAX sold) FROM fruits")
+ self.validate_identity("SELECT ANY_VALUE(fruit HAVING MIN sold) FROM fruits")
self.validate_identity("SELECT `project-id`.udfs.func(call.dir)")
self.validate_identity("SELECT CAST(CURRENT_DATE AS STRING FORMAT 'DAY') AS current_day")
self.validate_identity("SAFE_CAST(encrypted_value AS STRING FORMAT 'BASE64')")
diff --git a/tests/dialects/test_snowflake.py b/tests/dialects/test_snowflake.py
index 4d2c392..e9826a6 100644
--- a/tests/dialects/test_snowflake.py
+++ b/tests/dialects/test_snowflake.py
@@ -550,7 +550,17 @@ class TestSnowflake(Validator):
"snowflake": "DATEADD(DAY, 5, CAST('2008-12-25' AS DATE))",
},
)
- self.validate_identity("DATEDIFF(DAY, 5, CAST('2008-12-25' AS DATE))")
+ self.validate_identity(
+ "DATEDIFF(DAY, CAST('2007-12-25' AS DATE), CAST('2008-12-25' AS DATE))"
+ )
+ self.validate_identity(
+ "TIMEDIFF(DAY, CAST('2007-12-25' AS DATE), CAST('2008-12-25' AS DATE))",
+ "DATEDIFF(DAY, CAST('2007-12-25' AS DATE), CAST('2008-12-25' AS DATE))",
+ )
+ self.validate_identity(
+ "TIMESTAMPDIFF(DAY, CAST('2007-12-25' AS DATE), CAST('2008-12-25' AS DATE))",
+ "DATEDIFF(DAY, CAST('2007-12-25' AS DATE), CAST('2008-12-25' AS DATE))",
+ )
def test_semi_structured_types(self):
self.validate_identity("SELECT CAST(a AS VARIANT)")