You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "L. C. Hsieh (Jira)" <ji...@apache.org> on 2021/05/19 03:45:00 UTC

[jira] [Created] (SPARK-35439) Use LinkedHashMap as the map of equivalent expressions to preserve insertion order

L. C. Hsieh created SPARK-35439:
-----------------------------------

             Summary: Use LinkedHashMap as the map of equivalent expressions to preserve insertion order
                 Key: SPARK-35439
                 URL: https://issues.apache.org/jira/browse/SPARK-35439
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 3.1.1, 3.0.2, 3.2.0
            Reporter: L. C. Hsieh
            Assignee: L. C. Hsieh


EquivalentExpressions maintains a map of equivalent expressions. It is HashMap now so the insertion order is not guaranteed to be preserved later. Subexpression elimination relies on retrieving subexpressions from the map. If there is child-parent relationships among the subexpressions, we want the child expressions come first than parent expressions, so we can replace child expressions in parent expressions with subexpression evaluation.

Although we add expressions recursively into the map with depth-first approach, when we retrieve the map values, it is not guaranteed that the order is preserved. We should use LinkedHashMap for this usage.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org