[ 
https://issues.apache.org/jira/browse/SPARK-11522?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xin Wu updated SPARK-11522:
---------------------------
    Description: 
Given an external table definition where the data consists of many CSV files, 
{{input_file_name()}} returns empty strings.

Table definition:

{code}
CREATE EXTERNAL TABLE external_test(page_id INT, impressions INT) 
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
   "separatorChar" = ",",
   "quoteChar"     = "\"",
   "escapeChar"    = "\\"
)  
LOCATION 'file:///Users/sim/spark/test/external_test'
{code}

Query: 

{code}
sql("SELECT input_file_name() as file FROM external_test").show
{code}

Output:

{code}
+----+
|file|
+----+
|    |
|    |
...
|    |
+----+
{code}

  was:
Given an external table definition where the data consists of many CSV files, 
{{input_file_path()}} returns empty strings.

Table definition:

{code}
CREATE EXTERNAL TABLE external_test(page_id INT, impressions INT) 
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
   "separatorChar" = ",",
   "quoteChar"     = "\"",
   "escapeChar"    = "\\"
)  
LOCATION 'file:///Users/sim/spark/test/external_test'
{code}

Query: 

{code}
sql("SELECT input_file_name() as file FROM external_test").show
{code}

Output:

{code}
+----+
|file|
+----+
|    |
|    |
...
|    |
+----+
{code}


> input_file_name() returns "" for external tables
> ------------------------------------------------
>
>                 Key: SPARK-11522
>                 URL: https://issues.apache.org/jira/browse/SPARK-11522
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.5.1
>            Reporter: Simeon Simeonov
>              Labels: external-tables, hive, sql
>
> Given an external table definition where the data consists of many CSV files, 
> {{input_file_name()}} returns empty strings.
> Table definition:
> {code}
> CREATE EXTERNAL TABLE external_test(page_id INT, impressions INT) 
> ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
> WITH SERDEPROPERTIES (
>    "separatorChar" = ",",
>    "quoteChar"     = "\"",
>    "escapeChar"    = "\\"
> )  
> LOCATION 'file:///Users/sim/spark/test/external_test'
> {code}
> Query: 
> {code}
> sql("SELECT input_file_name() as file FROM external_test").show
> {code}
> Output:
> {code}
> +----+
> |file|
> +----+
> |    |
> |    |
> ...
> |    |
> +----+
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to