You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Allison Wang (Jira)" <ji...@apache.org> on 2023/10/27 22:01:00 UTC
[jira] [Updated] (SPARK-45639) Support loading Python data sources in DataFrameReader
[ https://issues.apache.org/jira/browse/SPARK-45639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Allison Wang updated SPARK-45639:
---------------------------------
Summary: Support loading Python data sources in DataFrameReader (was: Support Python data source in DataFrameReader)
> Support loading Python data sources in DataFrameReader
> ------------------------------------------------------
>
> Key: SPARK-45639
> URL: https://issues.apache.org/jira/browse/SPARK-45639
> Project: Spark
> Issue Type: Sub-task
> Components: PySpark
> Affects Versions: 4.0.0
> Reporter: Allison Wang
> Priority: Major
>
> Allow users to read from a Python data source using `spark.read.format(...).load()`
> For example
> Users can extend the DataSource and the DataSourceReader classes to create their own Python data source reader and use them in PySpark:
> {code:java}
> class MyReader(DataSourceReader):
> def read(self, partition):
> yield (0, 1)
> class MyDataSource(DataSource):
> def schema(self):
> return "id INT, value INT"
> def reader(self, schema):
> return MyReader()
> df = spark.read.format("MyDataSource").load()
> df.show()
> +---+-----+
> | id|value|
> +---+-----+
> | 0| 1|
> +---+-----+
> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org