diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-10 09:23:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-10 09:23:46 +0000 |
commit | 5dde903f4f6659e384287a3e508b9f369c5a2ba3 (patch) | |
tree | 05cd2920d82f0023f6ac695dbb6eaeef64608401 /tests/dialects/test_bigquery.py | |
parent | Adding upstream version 17.9.1. (diff) | |
download | sqlglot-5dde903f4f6659e384287a3e508b9f369c5a2ba3.tar.xz sqlglot-5dde903f4f6659e384287a3e508b9f369c5a2ba3.zip |
Adding upstream version 17.11.0.upstream/17.11.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_bigquery.py')
-rw-r--r-- | tests/dialects/test_bigquery.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/dialects/test_bigquery.py b/tests/dialects/test_bigquery.py index 8d01ebe..b5f91cf 100644 --- a/tests/dialects/test_bigquery.py +++ b/tests/dialects/test_bigquery.py @@ -200,8 +200,15 @@ class TestBigQuery(Validator): ) self.validate_all( "REGEXP_CONTAINS('foo', '.*')", - read={"bigquery": "REGEXP_CONTAINS('foo', '.*')"}, - write={"mysql": "REGEXP_LIKE('foo', '.*')"}, + read={ + "bigquery": "REGEXP_CONTAINS('foo', '.*')", + "mysql": "REGEXP_LIKE('foo', '.*')", + "starrocks": "REGEXP('foo', '.*')", + }, + write={ + "mysql": "REGEXP_LIKE('foo', '.*')", + "starrocks": "REGEXP('foo', '.*')", + }, ), self.validate_all( '"""x"""', @@ -481,13 +488,21 @@ class TestBigQuery(Validator): write={ "bigquery": "DATE_DIFF(CAST('2010-07-07' AS DATE), CAST('2008-12-25' AS DATE), DAY)", "mysql": "DATEDIFF(CAST('2010-07-07' AS DATE), CAST('2008-12-25' AS DATE))", + "starrocks": "DATE_DIFF('DAY', CAST('2010-07-07' AS DATE), CAST('2008-12-25' AS DATE))", + }, + ) + self.validate_all( + "DATE_DIFF(CAST('2010-07-07' AS DATE), CAST('2008-12-25' AS DATE), DAY)", + read={ + "mysql": "DATEDIFF(CAST('2010-07-07' AS DATE), CAST('2008-12-25' AS DATE))", + "starrocks": "DATEDIFF(CAST('2010-07-07' AS DATE), CAST('2008-12-25' AS DATE))", }, ) self.validate_all( "DATE_DIFF(DATE '2010-07-07', DATE '2008-12-25', MINUTE)", write={ "bigquery": "DATE_DIFF(CAST('2010-07-07' AS DATE), CAST('2008-12-25' AS DATE), MINUTE)", - "mysql": "DATEDIFF(CAST('2010-07-07' AS DATE), CAST('2008-12-25' AS DATE))", + "starrocks": "DATE_DIFF('MINUTE', CAST('2010-07-07' AS DATE), CAST('2008-12-25' AS DATE))", }, ) self.validate_all( |