summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_hive.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 08:14:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 08:14:01 +0000
commit705d595e4873c2b13dd98d4614ca729f4d4ed81c (patch)
treed42152d0d58a859ebf2eff8e5688f988f376703d /tests/dialects/test_hive.py
parentReleasing debian version 25.26.0-1. (diff)
downloadsqlglot-705d595e4873c2b13dd98d4614ca729f4d4ed81c.tar.xz
sqlglot-705d595e4873c2b13dd98d4614ca729f4d4ed81c.zip
Merging upstream version 25.29.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.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/dialects/test_hive.py b/tests/dialects/test_hive.py
index e40a85a..f13d92c 100644
--- a/tests/dialects/test_hive.py
+++ b/tests/dialects/test_hive.py
@@ -1,5 +1,7 @@
from tests.dialects.test_dialect import Validator
+from sqlglot import exp
+
class TestHive(Validator):
dialect = "hive"
@@ -787,6 +789,23 @@ class TestHive(Validator):
},
)
+ self.validate_identity("EXISTS(col, x -> x % 2 = 0)").assert_is(exp.Exists)
+
+ self.validate_all(
+ "SELECT EXISTS(ARRAY(2, 3), x -> x % 2 = 0)",
+ read={
+ "hive": "SELECT EXISTS(ARRAY(2, 3), x -> x % 2 = 0)",
+ "spark2": "SELECT EXISTS(ARRAY(2, 3), x -> x % 2 = 0)",
+ "spark": "SELECT EXISTS(ARRAY(2, 3), x -> x % 2 = 0)",
+ "databricks": "SELECT EXISTS(ARRAY(2, 3), x -> x % 2 = 0)",
+ },
+ write={
+ "spark2": "SELECT EXISTS(ARRAY(2, 3), x -> x % 2 = 0)",
+ "spark": "SELECT EXISTS(ARRAY(2, 3), x -> x % 2 = 0)",
+ "databricks": "SELECT EXISTS(ARRAY(2, 3), x -> x % 2 = 0)",
+ },
+ )
+
def test_escapes(self) -> None:
self.validate_identity("'\n'", "'\\n'")
self.validate_identity("'\\n'")