spark-instrumented-optimizer/sql/core/src/main
Wenchen Fan d8b50f7029 [SPARK-11453][SQL] append data to partitioned table will messes up the result
The reason is that:

1. For partitioned hive table, we will move the partitioned columns after data columns. (e.g. `<a: Int, b: Int>` partition by `a` will become `<b: Int, a: Int>`)
2. When append data to table, we use position to figure out how to match input columns to table's columns.

So when we append data to partitioned table, we will match wrong columns between input and table. A solution is reordering the input columns before match by position, like what we did for [`InsertIntoHadoopFsRelation`](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InsertIntoHadoopFsRelation.scala#L101-L105)

Author: Wenchen Fan <wenchen@databricks.com>

Closes #9408 from cloud-fan/append.
2015-11-08 21:01:53 -08:00
..
java/org/apache/spark/sql [SPARK-7542][SQL] Support off-heap index/sort buffer 2015-11-05 19:02:18 -08:00
resources [SPARK-11274] [SQL] Text data source support for Spark SQL. 2015-10-23 13:04:06 -07:00
scala/org/apache/spark/sql [SPARK-11453][SQL] append data to partitioned table will messes up the result 2015-11-08 21:01:53 -08:00