Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12750#discussion_r61666385
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/types/Metadata.scala ---
    @@ -85,17 +85,18 @@ sealed class Metadata private[types] (private[types] 
val map: Map[String, Any])
       override def equals(obj: Any): Boolean = {
         obj match {
           case that: Metadata =>
    -        if (map.keySet == that.map.keySet) {
    --- End diff --
    
    This old implementation of `Metadata.equals()` was insanely inefficient 
because `map.keySet()` performs tons of object allocation. The old code also 
used `array.view` to compare array contents for equality, which is going to be 
slower than `Arrays.equals()`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to