[ https://issues.apache.org/jira/browse/SPARK-25389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Spark reassigned SPARK-25389: ------------------------------------ Assignee: Apache Spark > 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: Apache Spark > Priority: Major > > 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-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org