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


##########
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:
   Sure, will fix! Just wanted to make it explicit that `resolvedValues`'s 
nested collection type should be `IndexedSeq` instead of relying on type 
inference.



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