summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_spark.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-03 06:02:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-03 06:02:47 +0000
commite67dc36ad88f4bbf01ffb495fe2ae846424ac015 (patch)
tree4d0c88b54afb1aafaa01ace15650affa6f436195 /tests/dialects/test_spark.py
parentAdding upstream version 10.5.10. (diff)
downloadsqlglot-e67dc36ad88f4bbf01ffb495fe2ae846424ac015.tar.xz
sqlglot-e67dc36ad88f4bbf01ffb495fe2ae846424ac015.zip
Adding upstream version 10.6.0.upstream/10.6.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_spark.py')
-rw-r--r--tests/dialects/test_spark.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/dialects/test_spark.py b/tests/dialects/test_spark.py
index fad858c..02d43aa 100644
--- a/tests/dialects/test_spark.py
+++ b/tests/dialects/test_spark.py
@@ -208,6 +208,13 @@ TBLPROPERTIES (
def test_spark(self):
self.validate_identity("SELECT UNIX_TIMESTAMP()")
+ self.validate_identity("TRIM(' SparkSQL ')")
+ self.validate_identity("TRIM(BOTH 'SL' FROM 'SSparkSQLS')")
+ self.validate_identity("TRIM(LEADING 'SL' FROM 'SSparkSQLS')")
+ self.validate_identity("TRIM(TRAILING 'SL' FROM 'SSparkSQLS')")
+ self.validate_all(
+ "TRIM('SL', 'SSparkSQLS')", write={"spark": "TRIM('SL' FROM 'SSparkSQLS')"}
+ )
self.validate_all(
"ARRAY_SORT(x, (left, right) -> -1)",
write={
@@ -314,5 +321,5 @@ TBLPROPERTIES (
def test_bool_or(self):
self.validate_all(
"SELECT a, LOGICAL_OR(b) FROM table GROUP BY a",
- write={"duckdb": "SELECT a, BOOL_OR(b) FROM table GROUP BY a"},
+ write={"spark": "SELECT a, BOOL_OR(b) FROM table GROUP BY a"},
)