impala-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Tauber-Marshall (JIRA)" <>
Subject [jira] [Created] (IMPALA-5753) Consider Expr nullability in rewrite rules
Date Wed, 02 Aug 2017 18:42:00 GMT
Thomas Tauber-Marshall created IMPALA-5753:

             Summary: Consider Expr nullability in rewrite rules
                 Key: IMPALA-5753
             Project: IMPALA
          Issue Type: Improvement
          Components: Frontend
    Affects Versions: Impala 2.10.0
            Reporter: Thomas Tauber-Marshall

A recent change, IMPALA-5016, added an expr rewrite rule that simplifies coalesce(). This
rule eliminated the coalesce when its first parameter (that isn't constant null) is non-nullable.

It considered parameters to be non-nullable if they were SlotRefs that pointed to non-nullable
SlotDescriptors. However, this approach has two problems:
- Its incorrect if the slot has been outer joined on (IMPALA-5725)
- It misses some opportunities for optimizations, for example '<non-nullable SlotRef>
+ <non-null constant>' would be non-nullable but wouldn't have been eliminated since
its not just a simple SlotRef.

What we really need is a concept of the nullability of Exprs, so for example a SlotRefs nullability
would be passed on the nullability of its SlotDescriptor and whether its the output of an
outer join, the nullability of a BinaryPredicate would be based on the nullability of its
children, etc.

This would be useful for other expr rewrite rules besides coalesce() (such as simplifying

This message was sent by Atlassian JIRA

View raw message