HyukjinKwon commented on code in PR #47384:
URL: https://github.com/apache/spark/pull/47384#discussion_r1680651472


##########
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:
   use `output.partition`?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to