summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_hive.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-24 08:03:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-24 08:03:45 +0000
commitca57dc468e5d8d0920e964d45ad25271ae6e633d (patch)
tree319d8bffcb5c3e9afe9e62beca9ef401480578d2 /tests/dialects/test_hive.py
parentAdding upstream version 17.4.1. (diff)
downloadsqlglot-ca57dc468e5d8d0920e964d45ad25271ae6e633d.tar.xz
sqlglot-ca57dc468e5d8d0920e964d45ad25271ae6e633d.zip
Adding upstream version 17.7.0.upstream/17.7.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.py44
1 files changed, 32 insertions, 12 deletions
diff --git a/tests/dialects/test_hive.py b/tests/dialects/test_hive.py
index 0503f6a..6dd484f 100644
--- a/tests/dialects/test_hive.py
+++ b/tests/dialects/test_hive.py
@@ -7,28 +7,57 @@ class TestHive(Validator):
def test_bits(self):
self.validate_all(
"x & 1",
- write={
+ read={
"duckdb": "x & 1",
"presto": "BITWISE_AND(x, 1)",
+ "spark": "x & 1",
+ },
+ write={
+ "duckdb": "x & 1",
"hive": "x & 1",
+ "presto": "BITWISE_AND(x, 1)",
"spark": "x & 1",
},
)
self.validate_all(
- "~x",
+ "x & 1 > 0",
+ read={
+ "duckdb": "x & 1 > 0",
+ "presto": "BITWISE_AND(x, 1) > 0",
+ "spark": "x & 1 > 0",
+ },
write={
+ "duckdb": "x & 1 > 0",
+ "presto": "BITWISE_AND(x, 1) > 0",
+ "hive": "x & 1 > 0",
+ "spark": "x & 1 > 0",
+ },
+ )
+ self.validate_all(
+ "~x",
+ read={
"duckdb": "~x",
"presto": "BITWISE_NOT(x)",
+ "spark": "~x",
+ },
+ write={
+ "duckdb": "~x",
"hive": "~x",
+ "presto": "BITWISE_NOT(x)",
"spark": "~x",
},
)
self.validate_all(
"x | 1",
- write={
+ read={
"duckdb": "x | 1",
"presto": "BITWISE_OR(x, 1)",
+ "spark": "x | 1",
+ },
+ write={
+ "duckdb": "x | 1",
"hive": "x | 1",
+ "presto": "BITWISE_OR(x, 1)",
"spark": "x | 1",
},
)
@@ -56,15 +85,6 @@ class TestHive(Validator):
"spark": "SHIFTRIGHT(x, 1)",
},
)
- self.validate_all(
- "x & 1 > 0",
- write={
- "duckdb": "x & 1 > 0",
- "presto": "BITWISE_AND(x, 1) > 0",
- "hive": "x & 1 > 0",
- "spark": "x & 1 > 0",
- },
- )
def test_cast(self):
self.validate_all(