Github user chenghao-intel commented on the pull request:

    https://github.com/apache/spark/pull/9480#issuecomment-154316345
  
    In general, I think we'd better add more IR (Intermediate Representation, 
should be the Expression or Logical Plan node here) for common sub expression 
cases, and we then we can identify the common sub expressions and transform to 
the new IRs, which should be more clean for code gen part of work.
    
    As the codegen code is a runtime behavior, which is difficult to debug and 
maintain, more IR will be helpful for this case, and that's also how a modern 
compiler works.
    
    And I don't think the approach I described can be done right now, it's will 
be a big change, actually, we have lots of similar optimization like "Common 
Table Expression" (CTE), or self join can be optimized in the same way, it will 
be cool if we can figure a approach for the general common xxx elimination.


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