You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xin Wu (JIRA)" <ji...@apache.org> on 2015/11/05 19:27:27 UTC
[jira] [Commented] (SPARK-11522) input_file_name() returns "" for
external tables
[ https://issues.apache.org/jira/browse/SPARK-11522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14992183#comment-14992183 ]
Xin Wu commented on SPARK-11522:
--------------------------------
I can recreate this issue with simpler case on 1.6.0 code base too.
{code}
spark-sql> create external table external_test (page_id int, impressions int) location 'file:///root/spark-tables/external_test';
{code}
where `external_test` contain one file or 2 files.
And {code} select input_file_name() as file from external_test {code} returns nothing.
I am looking into this 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_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}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org