-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-16044][SQL] input_file_name() returns empty strings in data sources based on NewHadoopRDD #13759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
Author
|
cc @cloud-fan Could you please take a look maybe? I remember renaming |
|
Test build #60769 has finished for PR 13759 at commit
|
Contributor
|
LGTM - merging in master/2.0. |
asfgit
pushed a commit
that referenced
this pull request
Jun 21, 2016
…urces based on NewHadoopRDD ## What changes were proposed in this pull request? This PR makes `input_file_name()` function return the file paths not empty strings for external data sources based on `NewHadoopRDD`, such as [spark-redshift](https://github.com/databricks/spark-redshift/blob/cba5eee1ab79ae8f0fa9e668373a54d2b5babf6b/src/main/scala/com/databricks/spark/redshift/RedshiftRelation.scala#L149) and [spark-xml](https://github.com/databricks/spark-xml/blob/master/src/main/scala/com/databricks/spark/xml/util/XmlFile.scala#L39-L47). The codes with the external data sources below: ```scala df.select(input_file_name).show() ``` will produce - **Before** ``` +-----------------+ |input_file_name()| +-----------------+ | | +-----------------+ ``` - **After** ``` +--------------------+ | input_file_name()| +--------------------+ |file:/private/var...| +--------------------+ ``` ## How was this patch tested? Unit tests in `ColumnExpressionSuite`. Author: hyukjinkwon <[email protected]> Closes #13759 from HyukjinKwon/SPARK-16044. (cherry picked from commit 4f7f1c4) Signed-off-by: Reynold Xin <[email protected]>
Member
Author
|
Thank you @rxin! Would this be sensible if this one is backported to branch 1-6? |
Contributor
|
Can you submit a pr for 1.6? Thanks. |
Member
Author
|
@rxin Sure! |
asfgit
pushed a commit
that referenced
this pull request
Jun 29, 2016
…n NewHadoopRDD to branch 1.6 ## What changes were proposed in this pull request? This PR backports #13759. (`SqlNewHadoopRDDState` was renamed to `InputFileNameHolder` and `spark` API does not exist in branch 1.6) ## How was this patch tested? Unit tests in `ColumnExpressionSuite`. Author: hyukjinkwon <[email protected]> Closes #13806 from HyukjinKwon/backport-SPARK-16044.
zzcclp
pushed a commit
to zzcclp/spark
that referenced
this pull request
Jun 30, 2016
…n NewHadoopRDD to branch 1.6 ## What changes were proposed in this pull request? This PR backports apache#13759. (`SqlNewHadoopRDDState` was renamed to `InputFileNameHolder` and `spark` API does not exist in branch 1.6) ## How was this patch tested? Unit tests in `ColumnExpressionSuite`. Author: hyukjinkwon <[email protected]> Closes apache#13806 from HyukjinKwon/backport-SPARK-16044. (cherry picked from commit 1ac830a)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR makes
input_file_name()function return the file paths not empty strings for external data sources based onNewHadoopRDD, such as spark-redshift and spark-xml.The codes with the external data sources below:
will produce
Before
After
How was this patch tested?
Unit tests in
ColumnExpressionSuite.