Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
Impala 2.1
-
None
-
None
-
RHEL 6.5 and CENTOS 6.4
Description
The following query is producing invalid tuple_idx when executing. If the INSRET INTO is changed into a CREATE TABLE AS statement it executes fine.
CREATE TABLE test1 (a bigint, b string, c string) PARTITIONED BY (d int); CREATE TABLE test2 (a bigint, b string, c string) PARTITIONED BY (d int); INSERT INTO test2 PARTITION(d) SELECT SUM(a) OVER ( PARTITION BY b ORDER BY c ROWS UNBOUNDED PRECEDING ) AS a ,b ,c ,d FROM test1;
Workaround
Force expression materialization via a UNION ALL as follows:
INSERT INTO test2
PARTITION(d)
SELECT
SUM(a) OVER (
PARTITION BY b ORDER BY c ROWS UNBOUNDED PRECEDING
)
AS a
,b
,c
,d
FROM test1
UNION ALL <--- Adding UNION ALL with the SELECT statement below is the workaround
SELECT NULL, NULL, NULL, NULL from test1 WHERE false;