From 705d595e4873c2b13dd98d4614ca729f4d4ed81c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 9 Nov 2024 09:14:01 +0100 Subject: Merging upstream version 25.29.0. Signed-off-by: Daniel Baumann --- tests/dialects/test_hive.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/dialects/test_hive.py') 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'") -- cgit v1.2.3