Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
Impala 2.3.0, Impala 2.5.0, Impala 2.4.0, Impala 2.6.0, Impala 2.7.0
Description
Unions with nested unions can produce incorrect results due to missing casts.
This bug can happen for both UNION ALL and UNION DISTINCT.
Repro:
create table t (d double); insert into t values(5.5); select d from t union all values(cast(6.2 as float)); +------------------------+ | d | +------------------------+ | 5.5 | | 5.369229582389968e-315 | +------------------------+ select d from t union all (select 10 union all select 20); +------------------------+ | d | +------------------------+ | 5.5 | | 4.940656458412465e-323 | | 9.881312916824931e-323 | +------------------------+
The underlying problem is that after unnesting unions we need to re-apply casts to the exprs of the unnested operands which my not be the same as the exprs of the original operand.