Skip to content

Commit 5c09d31

Browse files
author
Ghislain Fourny
committed
Fix config() call and add withDelta() option to the builder.
1 parent 59a858c commit 5c09d31

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ description = "Python edition of RumbleDB, a JSONiq engine"
99
requires-python = ">=3.11"
1010
dependencies = [
1111
"pyspark==4.0",
12-
"pandas>=2.2"
12+
"pandas>=2.2",
13+
"delta-spark==4.0"
1314
]
1415
authors = [
1516
{name = "Ghislain Fourny", email = "ghislain.fourny@inf.ethz.ch"},

src/jsoniq/session.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,15 @@ def master(self, url):
111111
self._sparkbuilder = self._sparkbuilder.master(url);
112112
return self;
113113

114-
def config(self, key, value):
115-
self._sparkbuilder = self._sparkbuilder.config(key, value);
114+
def config(self, key=None, value=None, conf=None, *, map=None):
115+
self._sparkbuilder = self._sparkbuilder.config(key=key, value=value, conf=conf, map=map)
116116
return self;
117117

118-
def config(self, conf):
119-
self._sparkbuilder = self._sparkbuilder.config(conf);
118+
def withDelta(self):
119+
self._sparkbuilder = self._sparkbuilder \
120+
.config("spark.sql.extensions", "io.delta.sql.DeltaSparkSessionExtension") \
121+
.config("spark.sql.catalog.spark_catalog", "org.apache.spark.sql.delta.catalog.DeltaCatalog") \
122+
.config("spark.jars.packages", "io.delta:delta-spark_2.13:4.0.0")
120123
return self;
121124

122125
def __getattr__(self, name):

0 commit comments

Comments
 (0)