[
https://issues.apache.org/jira/browse/IMPALA-6323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16677132#comment-16677132
]
ASF subversion and git services commented on IMPALA-6323:
---------------------------------------------------------
Commit cf89c73485c119d5068be1cdddf1acbd3c8acfd5 in impala's branch
refs/heads/master from [~mostrows]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=cf89c73 ]
IMPALA-6323 Allow constant analytic window expressions.
The constraint imposed by IMPALA-1354 was artificial.
If there are constant "partition by" expressions, simply drop them,
they are no-ops.
Constant "order by" expressions can be ignored as well, though in effect
they should be accounted for as null expressions in the backend, with the
effect that combine all rows in the same window (i.e. no window breaks).
Change-Id: Idf129026c45120e9470df601268863634037908c
Reviewed-on: http://gerrit.cloudera.org:8080/11556
Tested-by: Impala Public Jenkins <[email protected]>
Reviewed-by: Michael Ho <[email protected]>
> Support a constant in a window specification
> --------------------------------------------
>
> Key: IMPALA-6323
> URL: https://issues.apache.org/jira/browse/IMPALA-6323
> Project: IMPALA
> Issue Type: Improvement
> Components: Frontend
> Affects Versions: Impala 2.9.0
> Reporter: N Campbell
> Assignee: Michal Ostrowski
> Priority: Major
> Fix For: Impala 3.1.0
>
>
> A query may attempt to generate a function/aggregate with a window
> specification.
> Currently, Impala does not support a constant in the specification. Similarly
> it may also fail if an expression is generated which via constant folding
> becomes a constant.
> Potentially an application may have to trigger dynamic expressions which
> participate in a window specification. It may not know that a
> value-expression that is generated might be constant folded and disallowed.
> Hence, while it may attempt to decompose when it knows a literal is being
> used cannot guard for all cases
> Error: [Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement.
> Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000,
> errorMessage:AnalysisException: Expressions in the PARTITION BY clause must
> not be constant: upper('a') (in sum(qty) OVER (PARTITION BY upper('a')))
> ), Query: SELECT
> `sno` AS `c1`,
> SUM(`qty`)
> OVER(
> PARTITION BY
> upper('a')
> ) AS `c2`
> FROM `cert`.`tsupply`.
> SQLState: HY000
> ErrorCode: 500051
> -vs-
> SELECT
> `sno` AS `c1`,
> SUM(`qty`)
> OVER(
> PARTITION BY
> upper(concat(`sno`,''))
> ) AS `c2`
> FROM `cert`.`tsupply`
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]