Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/9408#discussion_r43853474
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala ---
@@ -169,11 +169,21 @@ final class DataFrameWriter private[sql](df:
DataFrame) {
private def insertInto(tableIdent: TableIdentifier): Unit = {
val partitions = partitioningColumns.map(_.map(col => col -> (None:
Option[String])).toMap)
val overwrite = mode == SaveMode.Overwrite
+
+ // A partitioned relation schema's can be different from the input
logicalPlan, since
+ // partition columns are all moved after data column. We Project to
adjust the ordering.
+ // TODO: this belongs in the analyzer.
+ val input = partitioningColumns.map { parCols =>
+ val projectList = df.logicalPlan.output.filterNot(c =>
parCols.contains(c.name)) ++
--- End diff --
Do we need to consider case sensitivity for partition column names here?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]