forked from ibis-project/ibis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link existing tests with PySpark backend (ibis-project#7)
- Loading branch information
1 parent
45278cc
commit 9fe05ab
Showing
7 changed files
with
177 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
from ibis.pyspark.client import PysparkClient | ||
|
||
|
||
def connect(**kwargs): | ||
def connect(session): | ||
""" | ||
Create a `SparkClient` for use with Ibis. Pipes **kwargs into SparkClient, | ||
which pipes them into SparkContext. See documentation for SparkContext: | ||
https://spark.apache.org/docs/latest/api/python/_modules/pyspark/context.html#SparkContext | ||
""" | ||
client = PysparkClient(**kwargs) | ||
client = PysparkClient(session) | ||
|
||
# Spark internally stores timestamps as UTC values, and timestamp data that | ||
# is brought in without a specified time zone is converted as local time to | ||
# UTC with microsecond resolution. | ||
# https://spark.apache.org/docs/latest/sql-pyspark-pandas-with-arrow.html#timestamp-with-time-zone-semantics | ||
client._session.conf.set('spark.sql.session.timeZone', 'UTC') | ||
|
||
return client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters