summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_redshift.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-10 08:53:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-10 08:53:10 +0000
commitf7cb7fdb0fb5a8e2d053c1aa18dd98462401a64e (patch)
tree75bbd792c82b8d1e70b5561de82a5b270b61867c /tests/dialects/test_redshift.py
parentAdding upstream version 18.11.2. (diff)
downloadsqlglot-f7cb7fdb0fb5a8e2d053c1aa18dd98462401a64e.tar.xz
sqlglot-f7cb7fdb0fb5a8e2d053c1aa18dd98462401a64e.zip
Adding upstream version 18.11.6.upstream/18.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_redshift.py')
-rw-r--r--tests/dialects/test_redshift.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/dialects/test_redshift.py b/tests/dialects/test_redshift.py
index ae1b987..9f2761f 100644
--- a/tests/dialects/test_redshift.py
+++ b/tests/dialects/test_redshift.py
@@ -273,6 +273,22 @@ class TestRedshift(Validator):
"SELECT DATE_ADD('day', 1, DATE('2023-01-01'))",
"SELECT DATEADD(day, 1, CAST(DATE('2023-01-01') AS DATE))",
)
+ self.validate_identity(
+ """SELECT
+ c_name,
+ orders.o_orderkey AS orderkey,
+ index AS orderkey_index
+FROM customer_orders_lineitem AS c, c.c_orders AS orders AT index
+ORDER BY
+ orderkey_index""",
+ pretty=True,
+ )
+ self.validate_identity(
+ "SELECT attr AS attr, JSON_TYPEOF(val) AS value_type FROM customer_orders_lineitem AS c, UNPIVOT c.c_orders[0] WHERE c_custkey = 9451"
+ )
+ self.validate_identity(
+ "SELECT attr AS attr, JSON_TYPEOF(val) AS value_type FROM customer_orders_lineitem AS c, UNPIVOT c.c_orders AS val AT attr WHERE c_custkey = 9451"
+ )
def test_values(self):
# Test crazy-sized VALUES clause to UNION ALL conversion to ensure we don't get RecursionError