You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yin Huai (JIRA)" <ji...@apache.org> on 2015/02/11 04:36:12 UTC

[jira] [Resolved] (SPARK-5576) saveAsTable into Hive fails due to duplicate columns

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

Yin Huai resolved SPARK-5576.
-----------------------------
    Resolution: Won't Fix

I am resolving it per discussions in the PR (https://github.com/apache/spark/pull/4346).

> saveAsTable into Hive fails due to duplicate columns
> ----------------------------------------------------
>
>                 Key: SPARK-5576
>                 URL: https://issues.apache.org/jira/browse/SPARK-5576
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.2.0
>            Reporter: Dan Osipov
>
> Loading JSON files infers case sensitive schema, which results in an error if attempting to save to Hive.
> {code}
> import org.apache.spark.sql._
> import org.apache.spark.sql.hive._
> val hive = new HiveContext(sc)
> val data = hive.jsonFile("/path/")
> data.saveAsTable("table")
> {code}
> Results in an error:
> org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.ql.metadata.HiveException: Duplicate column name data-errorcode in the table definition.
> Outputting the schema shows the problem field:
>  |-- data-errorCode: string (nullable = true)
>  |-- data-errorcode: string (nullable = true)



--
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