-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[Python] Start of DuckDB Spark API #8083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or 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
Tishj
commented
Jun 28, 2023
|
Thanks! Looks great |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the start of the Spark DuckDB API, this API aims to be 1 to 1 compatible with PySpark, but internally it will use DuckDB.
Namely this PR introduces the following core classes:
SparkSession
This class wraps a DuckDBPyConnection and acts as a wrapper around the connection
Methods that are already implemented:
DataFrame
This class wraps a DuckDBPyRelation and acts as a wrapper around the relation
Methods that are already implemented:
Catalog
Part of the SparkSession, also wraps DuckDBPyConnection but exposes methods related to querying the catalog of the database
Methods that are already implemented:
Different levels of not implemented
Even the code for our Python client is written in C++, so for this API we wanted to write it in Python to make it easier for the users of the API to be able contribute to the API.
Some methods are planned to be implemented but aren't yet, but a lot of the methods are not explicitly planned to be implemented yet.
To differentiate between the two classes of "not implemented" we introduce a
ContributionsAcceptedError, which also inherits from NotImplementedError so they can be generically dealt with, but semantically it serves as a way to communicate that the method that threw this exception is not planned to be implemented by the core team.