File tree Expand file tree Collapse file tree 1 file changed +4
-17
lines changed
sql/core/src/main/scala/org/apache/spark/sql Expand file tree Collapse file tree 1 file changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -249,25 +249,12 @@ final class DataFrameWriter[T] private[sql](ds: Dataset[T]) {
249249 )
250250 }
251251
252- val partitions = normalizedParCols.map(_.map(col => col -> Option .empty[String ]).toMap)
253- val overwrite = mode == SaveMode .Overwrite
254-
255- // A partitioned relation's schema can be different from the input logicalPlan, since
256- // partition columns are all moved after data columns. We Project to adjust the ordering.
257- // TODO: this belongs to the analyzer.
258- val input = normalizedParCols.map { parCols =>
259- val (inputPartCols, inputDataCols) = df.logicalPlan.output.partition { attr =>
260- parCols.contains(attr.name)
261- }
262- Project (inputDataCols ++ inputPartCols, df.logicalPlan)
263- }.getOrElse(df.logicalPlan)
264-
265252 df.sparkSession.sessionState.executePlan(
266253 InsertIntoTable (
267- UnresolvedRelation (tableIdent),
268- partitions.getOrElse( Map .empty[String , Option [String ]]) ,
269- input ,
270- overwrite,
254+ table = UnresolvedRelation (tableIdent),
255+ partition = Map .empty[String , Option [String ]],
256+ child = df.logicalPlan ,
257+ overwrite = mode == SaveMode . Overwrite ,
271258 ifNotExists = false )).toRdd
272259 }
273260
You can’t perform that action at this time.
0 commit comments