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

    https://github.com/apache/spark/pull/12661#discussion_r62265714
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateOrdering.scala
 ---
    @@ -154,12 +154,14 @@ class LazilyGeneratedOrdering(val ordering: 
Seq[SortOrder]) extends Ordering[Int
       private[this] var generatedOrdering = GenerateOrdering.generate(ordering)
     
       def compare(a: InternalRow, b: InternalRow): Int = {
    +    if (generatedOrdering == null) {
    --- End diff --
    
    Should making the generatedOrdering as `lazy val` be enough? 
    
    see http://fdahms.com/2015/10/14/scala-and-the-transient-lazy-val-pattern/


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