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:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-10 08:53:14 +0000
commitcd37a3bcaced9283c20baa52837c96b524baec54 (patch)
tree101b1c1487aa832a982dd635cd3b00d4d2ea3ae9 /tests/dialects/test_redshift.py
parentReleasing progress-linux version 18.11.2-1. (diff)
downloadsqlglot-cd37a3bcaced9283c20baa52837c96b524baec54.tar.xz
sqlglot-cd37a3bcaced9283c20baa52837c96b524baec54.zip
Merging upstream version 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