[ 
https://issues.apache.org/jira/browse/IMPALA-7846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul Rogers reassigned IMPALA-7846:
-----------------------------------

    Assignee:     (was: Paul Rogers)

> Analyzer expression error checks done in wrong order
> ----------------------------------------------------
>
>                 Key: IMPALA-7846
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7846
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Frontend
>    Affects Versions: Impala 3.0
>            Reporter: Paul Rogers
>            Priority: Trivial
>
> The analyzer does thorough checks of expressions in various clauses of a 
> query to exclude those expressions types which are not supported in that 
> context. In general, when there is more than one check, we should do the most 
> specific first to give the user the most specific error message possible. For 
> example, consider the [check for WHERE clause 
> expressions|https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/analysis/SelectStmt.java#L316]:
> {code:java}
>         whereClause_.checkReturnsBool("WHERE clause", false);
>         Expr e = whereClause_.findFirstOf(AnalyticExpr.class);
>         if (e != null) {
>           throw new AnalysisException(
>               "WHERE clause must not contain analytic expressions: " + 
> e.toSql());
>         }
> {code}
> In the above, we first check that the expression is Boolean. Later we check 
> for analytic expressions. As a result, a {{WHERE}} clause with just an 
> analytic expression gets the Boolean error. For example:
> {code:sql}
> ...
> WHERE count(id) OVER (PARTITION BY id)
> {code}
> Though a minor point, the general rule should be to do the most specific 
> checks first, so that the above gets an error about analytic functions rather 
> than that the expression is not Boolean.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to