diff options
author | hyukjinkwon <gurwls223@gmail.com> | 2016-06-20 21:55:34 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-06-20 21:55:34 -0700 |
commit | 4f7f1c436205630ab77d3758d7210cc1a2f0d04a (patch) | |
tree | 5444ef9df4fee331c71d5a2ce78593d879448264 /docs/programming-guide.md | |
parent | 18a8a9b1f4114211cd108efda5672f2bd2c6e5cd (diff) | |
download | spark-4f7f1c436205630ab77d3758d7210cc1a2f0d04a.tar.gz spark-4f7f1c436205630ab77d3758d7210cc1a2f0d04a.tar.bz2 spark-4f7f1c436205630ab77d3758d7210cc1a2f0d04a.zip |
[SPARK-16044][SQL] input_file_name() returns empty strings in data sources 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 <gurwls223@gmail.com>
Closes #13759 from HyukjinKwon/SPARK-16044.
Diffstat (limited to 'docs/programming-guide.md')
0 files changed, 0 insertions, 0 deletions