summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_hive.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-07 11:39:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-07 11:39:43 +0000
commit341eb1a6bdf0dd5b015e5140d3b068c6fd3f4d87 (patch)
tree61fb7eca2238fb5d41d3906f4af41de03abd25ea /tests/dialects/test_hive.py
parentAdding upstream version 17.12.0. (diff)
downloadsqlglot-341eb1a6bdf0dd5b015e5140d3b068c6fd3f4d87.tar.xz
sqlglot-341eb1a6bdf0dd5b015e5140d3b068c6fd3f4d87.zip
Adding upstream version 18.2.0.upstream/18.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_hive.py')
-rw-r--r--tests/dialects/test_hive.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/dialects/test_hive.py b/tests/dialects/test_hive.py
index 4c463f7..70a05fd 100644
--- a/tests/dialects/test_hive.py
+++ b/tests/dialects/test_hive.py
@@ -390,6 +390,13 @@ class TestHive(Validator):
)
def test_hive(self):
+ self.validate_identity("SELECT * FROM my_table TIMESTAMP AS OF DATE_ADD(CURRENT_DATE, -1)")
+ self.validate_identity("SELECT * FROM my_table VERSION AS OF DATE_ADD(CURRENT_DATE, -1)")
+
+ self.validate_identity(
+ "SELECT ROW() OVER (DISTRIBUTE BY x SORT BY y)",
+ "SELECT ROW() OVER (PARTITION BY x ORDER BY y)",
+ )
self.validate_identity("SELECT transform")
self.validate_identity("SELECT * FROM test DISTRIBUTE BY y SORT BY x DESC ORDER BY l")
self.validate_identity(
@@ -591,7 +598,7 @@ class TestHive(Validator):
read={
"": "VAR_MAP(a, b, c, d)",
"clickhouse": "map(a, b, c, d)",
- "duckdb": "MAP(LIST_VALUE(a, c), LIST_VALUE(b, d))",
+ "duckdb": "MAP([a, c], [b, d])",
"hive": "MAP(a, b, c, d)",
"presto": "MAP(ARRAY[a, c], ARRAY[b, d])",
"spark": "MAP(a, b, c, d)",
@@ -599,7 +606,7 @@ class TestHive(Validator):
write={
"": "MAP(ARRAY(a, c), ARRAY(b, d))",
"clickhouse": "map(a, b, c, d)",
- "duckdb": "MAP(LIST_VALUE(a, c), LIST_VALUE(b, d))",
+ "duckdb": "MAP([a, c], [b, d])",
"presto": "MAP(ARRAY[a, c], ARRAY[b, d])",
"hive": "MAP(a, b, c, d)",
"spark": "MAP(a, b, c, d)",
@@ -609,7 +616,7 @@ class TestHive(Validator):
self.validate_all(
"MAP(a, b)",
write={
- "duckdb": "MAP(LIST_VALUE(a), LIST_VALUE(b))",
+ "duckdb": "MAP([a], [b])",
"presto": "MAP(ARRAY[a], ARRAY[b])",
"hive": "MAP(a, b)",
"spark": "MAP(a, b)",
@@ -717,9 +724,7 @@ class TestHive(Validator):
self.validate_identity("'\\\\n'")
self.validate_identity("''")
self.validate_identity("'\\\\'")
- self.validate_identity("'\z'")
self.validate_identity("'\\z'")
- self.validate_identity("'\\\z'")
self.validate_identity("'\\\\z'")
def test_data_type(self):