cloud-fan commented on code in PR #47484:
URL: https://github.com/apache/spark/pull/47484#discussion_r1694406744


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala:
##########
@@ -263,12 +268,14 @@ case class PreprocessTableCreation(catalog: 
SessionCatalog) extends Rule[Logical
         DDLUtils.checkTableColumns(tableDesc)
         val normalizedTable = normalizeCatalogTable(tableDesc.schema, 
tableDesc)
 
+        val normalizedSchemaByName = HashMap(normalizedTable.schema.map(s => 
s.name -> s): _*)
         val partitionSchema = normalizedTable.partitionColumnNames.map { 
partCol =>
-          normalizedTable.schema.find(_.name == partCol).get
+          normalizedSchemaByName(partCol)
         }
-
-        val reorderedSchema =
-          
StructType(normalizedTable.schema.filterNot(partitionSchema.contains) ++ 
partitionSchema)
+        val partitionSchemaSet = HashSet(partitionSchema: _*)

Review Comment:
   This is a set of `StructField`?



-- 
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