LuciferYang commented on code in PR #57243:
URL: https://github.com/apache/spark/pull/57243#discussion_r3578964556


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala:
##########
@@ -398,7 +398,9 @@ object PartitioningUtils extends SQLConfHelper {
       // Resolves possible type conflicts for each column
       val values = pathsWithPartitionValues.map(_._2)
       val columnCount = values.head.columnNames.size
-      val resolvedValues = (0 until columnCount).map { i =>
+      // Enforcing nested collection as IndexedSeq guarantees O(1) element 
access.
+      // A linear Seq (like List) would cause O(n) lookups, degrading the 
subsequent loop to O(n²).
+      val resolvedValues: Seq[IndexedSeq[TypedPartValue]] = (0 until 
columnCount).map { i =>

Review Comment:
   Adding type declarations here is not mandatory; let’s keep the changes 
minimal.



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