mirror of
https://github.com/apache/impala.git
synced 2026-01-08 21:03:01 -05:00
IMPALA-4716: Expr rewrite causes IllegalStateException
The DECODE constructor in CaseExpr uses the same decodeExpr object when building the BinaryPredicates that compare the decodeExpr to each 'when' of the DECODE. This causes problems when different BinaryPredicates try to cast the same decodeExpr object to different types during analysis, in this case leading to a Precondition check failure. The solution is to clone the decodeExpr in the DECODE constructor in CaseExpr for each generated BinaryPredicate. Testing: - Added a regression test to exprs.test Change-Id: I4de9ed7118c8d18ec3f02ff74c9cca211c716e51 Reviewed-on: http://gerrit.cloudera.org:8080/5631 Reviewed-by: Marcel Kornacker <marcel@cloudera.com> Tested-by: Impala Public Jenkins
This commit is contained in:
committed by
Impala Public Jenkins
parent
c4f2458e39
commit
89a3d3c1eb
@@ -2649,3 +2649,19 @@ select count(*) from functional.alltypestiny group by concat(uuid(), "_test")
|
||||
---- TYPES
|
||||
BIGINT
|
||||
====
|
||||
---- QUERY
|
||||
# IMPALA-4716: Tests that decode with 'when' values of different types is analyzed
|
||||
# correctly when expr rewrites are enabled.
|
||||
select decode(0, 1, 0, id, 1, 2) a from functional.alltypestiny order by a
|
||||
---- RESULTS
|
||||
1
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
---- TYPES
|
||||
TINYINT
|
||||
====
|
||||
|
||||
Reference in New Issue
Block a user