[ 
https://issues.apache.org/jira/browse/SPARK-8315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14594144#comment-14594144
 ] 

Yin Huai commented on SPARK-8315:
---------------------------------

I tried the following in 1.4
{code}
import org.apache.spark.sql.functions._
val df1 = Seq((1, 1)).toDF("i", "j").as("t1")
val df2 = Seq((1, 1)).toDF("i", "j").as("t2")
val joined = df1.join(df2, col("t1.i") === col("t2.j"))
joined.explain(true)
joined.write.format("parquet").saveAsTable("yinParquetSameColumnNames")
{code}
and I got an analysis exception {{org.apache.spark.sql.AnalysisException: 
Reference 'i' is ambiguous, could be: i#30, i#34.;}}. Seems it is fixed in 1.4, 
but it will be good to add to add a regression test.

> Better error when saving to parquet with duplicate columns
> ----------------------------------------------------------
>
>                 Key: SPARK-8315
>                 URL: https://issues.apache.org/jira/browse/SPARK-8315
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Michael Armbrust
>            Priority: Critical
>
> Parquet allows you to silently write out files with duplicate column names 
> and then emits a very confusing error when trying to read the data back in:
> {code}
> Error in SQL statement: java.lang.RuntimeException: 
> org.apache.spark.SparkException: Job aborted due to stage failure: Task 4 in 
> stage 21.0 failed 4 times, most recent failure: Lost task 4.3 in stage 21.0 
> (TID 2767, ...): parquet.io.ParquetDecodingException: Can not read value at 0 
> in block -1 in file ...
> {code}
> We should throw a better error before attempting to write out an invalid file.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to