HyukjinKwon opened a new pull request, #44504:
URL: https://github.com/apache/spark/pull/44504
### What changes were proposed in this pull request?
This PR proposes to add the support of automatic Python Data Source
registration.
**End user perspective:**
```bash
# Assume that `customsource` defined a short name as `custom`
pip install pyspark_customsource
```
Users can directly use the Python Data Source
```python
df = spark.format("custom").load()
```
**Developer perspective:**
The packages should follow the structure below:
- The package name should start with `pyspark_` prefix
- `pyspark_*.DefaultSource` has to be defined that inherits
`pyspark.sql.datasource.DataSource`
For example:
```
pyspark_customsource
├── __init__.py
...
```
`__init__.py`:
```python
from pyspark.sql.datasource import DataSource
class DefaultSource(Datasource):
pass
```
### Why are the changes needed?
This allows the developers to release and maintain their 3rd party Python
Data Sources separately (e.g., in PyPI), and end users can easily install the
Python Data Source without doing anything other than just `pip install
pyspark_their_source`
### Does this PR introduce _any_ user-facing change?
Yes, this allows users to `pip install pyspark_custom_source`, and
automatically register it as Data Source available in Spark.
### How was this patch tested?
TBD
### Was this patch authored or co-authored using generative AI tooling?
No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]