vladimirg-db commented on code in PR #47384:
URL: https://github.com/apache/spark/pull/47384#discussion_r1680752823


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala:
##########
@@ -230,10 +232,13 @@ case class PreprocessTableCreation(catalog: 
SessionCatalog) extends Rule[Logical
         DDLUtils.checkTableColumns(tableDesc.copy(schema = 
analyzedQuery.schema))
 
         val output = analyzedQuery.output
-        val partitionAttrs = normalizedTable.partitionColumnNames.map { 
partCol =>
-          output.find(_.name == partCol).get
-        }
-        val newOutput = output.filterNot(partitionAttrs.contains) ++ 
partitionAttrs
+        val partitionColumnNames = 
HashSet(normalizedTable.partitionColumnNames: _*)
+        // testing...
+        val newOutput = output.filterNot(

Review Comment:
   Turnes out we need the order of partition attributes to be the same as 
`normalizedTable.partitionColumnNames` (caught it in the UTs). Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to