Paul Rogers created IMPALA-7896:
-----------------------------------

             Summary: Literals should not need explicit analyze step
                 Key: IMPALA-7896
                 URL: https://issues.apache.org/jira/browse/IMPALA-7896
             Project: IMPALA
          Issue Type: Improvement
          Components: Frontend
    Affects Versions: Impala 3.0
            Reporter: Paul Rogers
            Assignee: Paul Rogers


The Impala FE has the concept of a _lteral_ (string, boolean, null, number.) 
Originally, literals could only be created as part of the AST. Hence, all 
literals are subclasses of {{LiteralExpr}} which are {{ExprNodes}}. The 
analysis step is used to set the type of the literal numbers, when not known at 
create time. If literals were used only in the AST, this would be fine, they 
could be analyzed with an analyzer.

In fact, as the code has evolved, {{LiteralExpr}} nodes are created via the 
catalog, which has no analyzer. To fudge the issue, the 
{{LiteralExpr.create()}} function does analysis with a null analyzer. This, in 
turn, means that the {{analyze()}} code needs to special case a null analyzer. 
This, in turn, leads to brittle, error prone code.

Since literals are immutable (except, sadly, for type), it is better that they 
start analyzed. Since the only attribute which must be set is the type, and the 
type can be known at create time, we have the {{analyze()}} be an optional 
no-op, leading to cleaner semantics.




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to