diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-17 10:32:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-17 10:32:12 +0000 |
commit | 244a05de60c9417daab9528b51788c3d2a00dc5f (patch) | |
tree | 89a9c82aa41d397e1b81c320ad7a287b6c80f313 /tests/dialects/test_hive.py | |
parent | Adding upstream version 10.4.2. (diff) | |
download | sqlglot-upstream/10.5.2.tar.xz sqlglot-upstream/10.5.2.zip |
Adding upstream version 10.5.2.upstream/10.5.2
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.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/dialects/test_hive.py b/tests/dialects/test_hive.py index a7f3b8f..bbf00b1 100644 --- a/tests/dialects/test_hive.py +++ b/tests/dialects/test_hive.py @@ -339,6 +339,24 @@ class TestHive(Validator): def test_hive(self): self.validate_all( + "SELECT A.1a AS b FROM test_a AS A", + write={ + "spark": "SELECT A.1a AS b FROM test_a AS A", + }, + ) + self.validate_all( + "SELECT 1_a AS a FROM test_table", + write={ + "spark": "SELECT 1_a AS a FROM test_table", + }, + ) + self.validate_all( + "SELECT a_b AS 1_a FROM test_table", + write={ + "spark": "SELECT a_b AS 1_a FROM test_table", + }, + ) + self.validate_all( "PERCENTILE(x, 0.5)", write={ "duckdb": "QUANTILE(x, 0.5)", @@ -411,7 +429,7 @@ class TestHive(Validator): "INITCAP('new york')", write={ "duckdb": "INITCAP('new york')", - "presto": "REGEXP_REPLACE('new york', '(\w)(\w*)', x -> UPPER(x[1]) || LOWER(x[2]))", + "presto": r"REGEXP_REPLACE('new york', '(\w)(\w*)', x -> UPPER(x[1]) || LOWER(x[2]))", "hive": "INITCAP('new york')", "spark": "INITCAP('new york')", }, |