Uh oh!
There was an error while loading. Please reload this page.
[SPARK-16236] [SQL] Add Path Option back to Load API in DataFrameReader - #13933
[SPARK-16236] [SQL] Add Path Option back to Load API in DataFrameReader#13933gatorsmile wants to merge 2 commits into
Conversation
gatorsmile
commented
Jun 28, 2016
SparkQA
commented
Jun 28, 2016
Test build #61333 has finished for PR 13933 at commit
|
SparkQA
commented
Jun 28, 2016
Test build #61342 has finished for PR 13933 at commit
|
gatorsmile
commented
Jun 28, 2016
cc @rxin The code is ready for review. Thanks! |
rxin
commented
Jun 28, 2016
LGTM -- cc @tdas to take a look since he wrote the original patch. |
liancheng
commented
Jun 28, 2016
LGTM. |
rxin
commented
Jun 28, 2016
Merging in master/2.0. |
#### What changes were proposed in this pull request? koertkuipers identified the PR #13727 changed the behavior of `load` API. After the change, the `load` API does not add the value of `path` into the `options`. Thank you! This PR is to add the option `path` back to `load()` API in `DataFrameReader`, if and only if users specify one and only one `path` in the `load` API. For example, users can see the `path` option after the following API call, ```Scala spark.read .format("parquet") .load("/test") ``` #### How was this patch tested? Added test cases. Author: gatorsmile <gatorsmile@gmail.com> Closes#13933 from gatorsmile/optionPath. (cherry picked from commit 25520e9) Signed-off-by: Reynold Xin <rxin@databricks.com>
zsxwing
commented
Jun 28, 2016
I noticed that the Python API is inconsistent here: spark/python/pyspark/sql/readwriter.py Line 147 in 1aad8c6 It always calls |
gatorsmile
commented
Jun 29, 2016
@zsxwing Let me try to fix it. Thanks! |
gatorsmile
commented
Jun 29, 2016
The problem also exists in the other APIs: spark/sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala Lines 407 to 410 in 25520e9 Let me fix them in the same PR. Thanks! |
zsxwing
commented
Jun 29, 2016
@gatorsmile parquet, json or other file formats support both |
gatorsmile
commented
Jun 29, 2016
@zsxwing If we just provide one Could you review the new PR I just submitted? Let me know if anything is not appropriate. #13965. Thanks! |
koertkuipers
commented
Jun 30, 2016
For parquet, json etc. path not being put in options is not an issue since
|
What changes were proposed in this pull request?
@koertkuipers identified the PR #13727 changed the behavior of
loadAPI. After the change, theloadAPI does not add the value ofpathinto theoptions. Thank you!This PR is to add the option
pathback toload()API inDataFrameReader, if and only if users specify one and only onepathin theloadAPI. For example, users can see thepathoption after the following API call,How was this patch tested?
Added test cases.