Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Impala 2.9.0
-
None
-
ghx-label-9
Description
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`
Attachments
Issue Links
- causes
-
IMPALA-8069 crash in impala::Sorter::Run::Run
- Resolved
- relates to
-
IMPALA-2775 Randomly generated query fails with "Expressions in the ORDER BY clause must not be constant"
- Resolved