summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_spark.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-03 09:12:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-03 09:12:24 +0000
commit98d5537435b2951b36c45f1fda667fa27c165794 (patch)
treed26b4dfa6cf91847100fe10a94a04dcc2ad36a86 /tests/dialects/test_spark.py
parentAdding upstream version 11.5.2. (diff)
downloadsqlglot-98d5537435b2951b36c45f1fda667fa27c165794.tar.xz
sqlglot-98d5537435b2951b36c45f1fda667fa27c165794.zip
Adding upstream version 11.7.1.upstream/11.7.1
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.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/dialects/test_spark.py b/tests/dialects/test_spark.py
index 0da2931..bfaed53 100644
--- a/tests/dialects/test_spark.py
+++ b/tests/dialects/test_spark.py
@@ -215,6 +215,41 @@ TBLPROPERTIES (
self.validate_identity("SPLIT(str, pattern, lim)")
self.validate_all(
+ "BOOLEAN(x)",
+ write={
+ "": "CAST(x AS BOOLEAN)",
+ "spark": "CAST(x AS BOOLEAN)",
+ },
+ )
+ self.validate_all(
+ "INT(x)",
+ write={
+ "": "CAST(x AS INT)",
+ "spark": "CAST(x AS INT)",
+ },
+ )
+ self.validate_all(
+ "STRING(x)",
+ write={
+ "": "CAST(x AS TEXT)",
+ "spark": "CAST(x AS STRING)",
+ },
+ )
+ self.validate_all(
+ "DATE(x)",
+ write={
+ "": "CAST(x AS DATE)",
+ "spark": "CAST(x AS DATE)",
+ },
+ )
+ self.validate_all(
+ "TIMESTAMP(x)",
+ write={
+ "": "CAST(x AS TIMESTAMP)",
+ "spark": "CAST(x AS TIMESTAMP)",
+ },
+ )
+ self.validate_all(
"CAST(x AS TIMESTAMP)", read={"trino": "CAST(x AS TIMESTAMP(6) WITH TIME ZONE)"}
)
self.validate_all(