You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (JIRA)" <ji...@apache.org> on 2018/09/11 16:00:00 UTC
[jira] [Resolved] (SPARK-25389) INSERT OVERWRITE DIRECTORY STORED
AS should prevent duplicate fields
[ https://issues.apache.org/jira/browse/SPARK-25389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dongjoon Hyun resolved SPARK-25389.
-----------------------------------
Resolution: Fixed
Fix Version/s: 2.4.0
Issue resolved by pull request 22378
[https://github.com/apache/spark/pull/22378]
> INSERT OVERWRITE DIRECTORY STORED AS should prevent duplicate fields
> --------------------------------------------------------------------
>
> Key: SPARK-25389
> URL: https://issues.apache.org/jira/browse/SPARK-25389
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.3.0, 2.3.1
> Reporter: Dongjoon Hyun
> Assignee: Dongjoon Hyun
> Priority: Major
> Fix For: 2.4.0
>
>
> Like `INSERT OVERWRITE DIRECTORY USING` syntax, `INSERT OVERWRITE DIRECTORY STORED AS` should not generate files with duplicate fields because Spark cannot read those files.
> *INSERT OVERWRITE DIRECTORY USING*
> {code}
> scala> sql("INSERT OVERWRITE DIRECTORY 'file:///tmp/parquet' USING parquet SELECT 'id', 'id2' id")
> ... ERROR InsertIntoDataSourceDirCommand: Failed to write to directory ...
> org.apache.spark.sql.AnalysisException: Found duplicate column(s) when inserting into file:/tmp/parquet: `id`;
> {code}
> *INSERT OVERWRITE DIRECTORY STORED AS*
> {code}
> scala> sql("INSERT OVERWRITE DIRECTORY 'file:///tmp/parquet' STORED AS parquet SELECT 'id', 'id2' id")
> scala> spark.read.parquet("/tmp/parquet").show
> 18/09/09 22:09:57 WARN DataSource: Found duplicate column(s) in the data schema and the partition schema: `id`;
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org