summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/spark.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-09-30 05:07:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-09-30 05:07:28 +0000
commit5a674d94c3ab243e2dd6a00f9edf6cc50b018512 (patch)
tree0b6fe74b5b346f0b048162b56a12885f1a2c2912 /sqlglot/dialects/spark.py
parentReleasing debian version 6.2.1-1. (diff)
downloadsqlglot-5a674d94c3ab243e2dd6a00f9edf6cc50b018512.tar.xz
sqlglot-5a674d94c3ab243e2dd6a00f9edf6cc50b018512.zip
Merging upstream version 6.2.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/spark.py')
-rw-r--r--sqlglot/dialects/spark.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/sqlglot/dialects/spark.py b/sqlglot/dialects/spark.py
index c051178..5446e83 100644
--- a/sqlglot/dialects/spark.py
+++ b/sqlglot/dialects/spark.py
@@ -1,5 +1,9 @@
from sqlglot import exp
-from sqlglot.dialects.dialect import no_ilike_sql, rename_func
+from sqlglot.dialects.dialect import (
+ create_with_partitions_sql,
+ no_ilike_sql,
+ rename_func,
+)
from sqlglot.dialects.hive import Hive, HiveMap
from sqlglot.helper import list_get
@@ -10,7 +14,7 @@ def _create_sql(self, e):
if kind.upper() == "TABLE" and temporary is True:
return f"CREATE TEMPORARY VIEW {self.sql(e, 'this')} AS {self.sql(e, 'expression')}"
- return self.create_sql(e)
+ return create_with_partitions_sql(self, e)
def _map_sql(self, expression):
@@ -73,6 +77,7 @@ class Spark(Hive):
}
class Generator(Hive.Generator):
+
TYPE_MAPPING = {
**Hive.Generator.TYPE_MAPPING,
exp.DataType.Type.TINYINT: "BYTE",