You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Cheng Lian (JIRA)" <ji...@apache.org> on 2015/05/21 15:33:59 UTC

[jira] [Updated] (SPARK-7616) Column order can be corrupted when saving DataFrame as a partitioned table

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

Cheng Lian updated SPARK-7616:
------------------------------
    Summary: Column order can be corrupted when saving DataFrame as a partitioned table  (was: Overwriting a partitioned parquet table corrupt data)

> Column order can be corrupted when saving DataFrame as a partitioned table
> --------------------------------------------------------------------------
>
>                 Key: SPARK-7616
>                 URL: https://issues.apache.org/jira/browse/SPARK-7616
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.4.0
>            Reporter: Yin Huai
>            Assignee: Cheng Lian
>            Priority: Blocker
>
> {code}
> import sqlContext._
> import sqlContext.implicits._
> import org.apache.spark.sql.SaveMode
> val df = createDataFrame(Seq((1,2),(2,3),(3,4))).toDF("a", "b")
> df.saveAsTable("test2", "parquet", SaveMode.Overwrite, Map.empty[String, String], Seq("b"))
> table("test2").show
> // You will see
> // +-+-+
> // |a|b|
> // +-+-+
> // |1|2|
> // |2|3|
> // |3|4|
> // +-+-+
> df.saveAsTable("test2", "parquet", SaveMode.Overwrite, Map.empty[String, String], Seq("a"))
> table("test2").show
> // You will see
> // +-+-+
> // |b|a|
> // +-+-+
> // |1|2|
> // |2|3|
> // |3|4|
> // +-+-+
> {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