Skip to content
Snippets Groups Projects
Commit 39f2eb1d authored by gatorsmile's avatar gatorsmile Committed by Shixiong Zhu
Browse files

[SPARK-16236][SQL][FOLLOWUP] Add Path Option back to Load API in DataFrameReader

#### What changes were proposed in this pull request?
In Python API, we have the same issue. Thanks for identifying this issue, zsxwing ! Below is an example:
```Python
spark.read.format('json').load('python/test_support/sql/people.json')
```
#### How was this patch tested?
Existing test cases cover the changes by this PR

Author: gatorsmile <gatorsmile@gmail.com>

Closes #13965 from gatorsmile/optionPaths.
parent 8c9cd0a7
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,9 @@ class DataFrameReader(OptionUtils):
if schema is not None:
self.schema(schema)
self.options(**options)
if path is not None:
if isinstance(path, basestring):
return self._df(self._jreader.load(path))
elif path is not None:
if type(path) != list:
path = [path]
return self._df(self._jreader.load(self._spark._sc._jvm.PythonUtils.toSeq(path)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment