You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Paul Rogers (JIRA)" <ji...@apache.org> on 2018/10/25 23:43:00 UTC

[jira] [Created] (IMPALA-7766) Perform constant folding within an expression

Paul Rogers created IMPALA-7766:
-----------------------------------

             Summary: Perform constant folding within an expression
                 Key: IMPALA-7766
                 URL: https://issues.apache.org/jira/browse/IMPALA-7766
             Project: IMPALA
          Issue Type: Improvement
          Components: Frontend
    Affects Versions: Impala 3.0
            Reporter: Paul Rogers


Suppose we have the following query:

{code:sql}
SELECT id + 1 + 2, 2 + 3 FROM foo;
{code}

Then, examine the SELECT after rewrites (using the new {{FullRewriteTest}}.) We'd expect content folding. However, constant folding only happens if the entire expression is constant, it can't handle sub-expressions. Result:

{code:sql}
SELECT id + 1 + 2, 5 FROM foo;
{code}

Constant folding within an expression is tricky, and it is not clear what, if any, performance gain would be had. Still, it is worth keeping in mind.



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