summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_spark.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-10-10 11:29:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-10-10 11:29:00 +0000
commit74b38d30f43f7005428e09fa80508c5f21324c99 (patch)
tree7a0d4e49fffdc0330fc941c6528d3c8669a2acc6 /tests/dialects/test_spark.py
parentAdding upstream version 6.2.8. (diff)
downloadsqlglot-74b38d30f43f7005428e09fa80508c5f21324c99.tar.xz
sqlglot-74b38d30f43f7005428e09fa80508c5f21324c99.zip
Adding upstream version 6.3.1.upstream/6.3.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.py58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/dialects/test_spark.py b/tests/dialects/test_spark.py
index 8377e47..9a7e64c 100644
--- a/tests/dialects/test_spark.py
+++ b/tests/dialects/test_spark.py
@@ -111,12 +111,70 @@ TBLPROPERTIES (
"SELECT /*+ COALESCE(3) */ * FROM x",
write={
"spark": "SELECT /*+ COALESCE(3) */ * FROM x",
+ "bigquery": "SELECT * FROM x",
},
)
self.validate_all(
"SELECT /*+ COALESCE(3), REPARTITION(1) */ * FROM x",
write={
"spark": "SELECT /*+ COALESCE(3), REPARTITION(1) */ * FROM x",
+ "bigquery": "SELECT * FROM x",
+ },
+ )
+ self.validate_all(
+ "SELECT /*+ BROADCAST(table) */ cola FROM table",
+ write={
+ "spark": "SELECT /*+ BROADCAST(table) */ cola FROM table",
+ "bigquery": "SELECT cola FROM table",
+ },
+ )
+ self.validate_all(
+ "SELECT /*+ BROADCASTJOIN(table) */ cola FROM table",
+ write={
+ "spark": "SELECT /*+ BROADCASTJOIN(table) */ cola FROM table",
+ "bigquery": "SELECT cola FROM table",
+ },
+ )
+ self.validate_all(
+ "SELECT /*+ MAPJOIN(table) */ cola FROM table",
+ write={
+ "spark": "SELECT /*+ MAPJOIN(table) */ cola FROM table",
+ "bigquery": "SELECT cola FROM table",
+ },
+ )
+ self.validate_all(
+ "SELECT /*+ MERGE(table) */ cola FROM table",
+ write={
+ "spark": "SELECT /*+ MERGE(table) */ cola FROM table",
+ "bigquery": "SELECT cola FROM table",
+ },
+ )
+ self.validate_all(
+ "SELECT /*+ SHUFFLEMERGE(table) */ cola FROM table",
+ write={
+ "spark": "SELECT /*+ SHUFFLEMERGE(table) */ cola FROM table",
+ "bigquery": "SELECT cola FROM table",
+ },
+ )
+ self.validate_all(
+ "SELECT /*+ MERGEJOIN(table) */ cola FROM table",
+ write={
+ "spark": "SELECT /*+ MERGEJOIN(table) */ cola FROM table",
+ "bigquery": "SELECT cola FROM table",
+ },
+ )
+ self.validate_all(
+ "SELECT /*+ SHUFFLE_HASH(table) */ cola FROM table",
+ write={
+ "spark": "SELECT /*+ SHUFFLE_HASH(table) */ cola FROM table",
+ "bigquery": "SELECT cola FROM table",
+ },
+ )
+ self.validate_all(
+ "SELECT /*+ SHUFFLE_REPLICATE_NL(table) */ cola FROM table",
+ write={
+ "spark": "SELECT /*+ SHUFFLE_REPLICATE_NL(table) */ cola FROM table",
+ "bigquery": "SELECT cola FROM table",
},
)