HyukjinKwon commented on code in PR #43360:
URL: https://github.com/apache/spark/pull/43360#discussion_r1365227126
##########
python/pyspark/sql/readwriter.py:
##########
@@ -69,20 +83,26 @@ class DataFrameReader(OptionUtils):
def __init__(self, spark: "SparkSession"):
self._jreader = spark._jsparkSession.read()
self._spark = spark
+ self._format: Optional[Union[str, Type[DataSource]]] = None
+ self._schema: Optional[Union[str, StructType]] = None
+ self._options: Dict[str, "OptionalPrimitiveType"] = dict()
def _df(self, jdf: JavaObject) -> "DataFrame":
from pyspark.sql.dataframe import DataFrame
return DataFrame(jdf, self._spark)
- def format(self, source: str) -> "DataFrameReader":
+ def format(self, source: Union[str, Type[DataSource]]) ->
"DataFrameReader":
Review Comment:
1. Create a INI file either under Spark conf directory, or current working
directory (maybe optionally define the location via a static configuration).
2. Read it in `DataSource.lookupDataSource`, and loads the class. We will
likely need a wrapper class that inherits Scala Datasource classes.
3. The wrapper Datasource invokes the Python interface to read/write, etc.
--
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]