[
https://issues.apache.org/jira/browse/IMPALA-7846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul Rogers updated IMPALA-7846:
--------------------------------
Priority: Trivial (was: Minor)
Issue Type: Improvement (was: Bug)
> 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
> Assignee: 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: [email protected]
For additional commands, e-mail: [email protected]