diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-24 08:03:45 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-24 08:03:45 +0000 |
commit | ca57dc468e5d8d0920e964d45ad25271ae6e633d (patch) | |
tree | 319d8bffcb5c3e9afe9e62beca9ef401480578d2 /tests/dialects/test_bigquery.py | |
parent | Adding upstream version 17.4.1. (diff) | |
download | sqlglot-ca57dc468e5d8d0920e964d45ad25271ae6e633d.tar.xz sqlglot-ca57dc468e5d8d0920e964d45ad25271ae6e633d.zip |
Adding upstream version 17.7.0.upstream/17.7.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 | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/dialects/test_bigquery.py b/tests/dialects/test_bigquery.py index 3939ba0..69042be 100644 --- a/tests/dialects/test_bigquery.py +++ b/tests/dialects/test_bigquery.py @@ -1,6 +1,6 @@ from unittest import mock -from sqlglot import ErrorLevel, ParseError, UnsupportedError, transpile +from sqlglot import ErrorLevel, ParseError, TokenError, UnsupportedError, transpile from tests.dialects.test_dialect import Validator @@ -8,7 +8,7 @@ class TestBigQuery(Validator): dialect = "bigquery" def test_bigquery(self): - with self.assertRaises(ValueError): + with self.assertRaises(TokenError): transpile("'\\'", read="bigquery") # Reference: https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#set_operators @@ -521,6 +521,12 @@ class TestBigQuery(Validator): }, ) self.validate_all( + "SELECT * FROM UNNEST([STRUCT(1 AS id)]) CROSS JOIN UNNEST([STRUCT(1 AS id)])", + read={ + "postgres": "SELECT * FROM (VALUES (1)) AS t1(id) CROSS JOIN (VALUES (1)) AS t2(id)", + }, + ) + self.validate_all( "SELECT cola, colb, colc FROM (VALUES (1, 'test', NULL)) AS tab(cola, colb, colc)", write={ "spark": "SELECT cola, colb, colc FROM VALUES (1, 'test', NULL) AS tab(cola, colb, colc)", |