Member since
09-20-2020
1
Post
0
Kudos Received
0
Solutions
09-20-2020
10:26 PM
Hello, Observing "union all" is dropping records with all null/empty fields. CREATE tABLE IF NOT EXISTS
as_adventure.t1
(
productsubcategorykey INT,
productline STRING);
insert into t1 values (1,'l1');
insert into t1 values (2,'l1');
insert into t1 values (1,'l2');
insert into t1 values (3,'l3');
insert into t1 values (null,'');
select * from t1;
SELECT
MIN(t_53.c_41) c_41,
CAST(NULL AS DOUBLE) c_43,
CAST(NULL AS BIGINT) c_44,
t_53.c2 c2,
t_53.c3s0 c3s0,
t_53.c4 c4,
t_53.c5s0 c5s0
FROM
( SELECT
t.productsubcategorykey c_41,
t.productline c2,
t.productline c3s0,
t.productsubcategorykey c4,
t.productsubcategorykey c5s0
FROM
as_adventure.t1 t
WHERE
true
GROUP BY
2,
3,
4,
5 ) t_53
GROUP BY
4,
5,
6,
7
UNION ALL
SELECT
MIN(t_53.c_41) c_41,
CAST(NULL AS DOUBLE) c_43,
CAST(NULL AS BIGINT) c_44,
t_53.c2 c2,
t_53.c3s0 c3s0,
t_53.c4 c4,
t_53.c5s0 c5s0
FROM
( SELECT
t.productsubcategorykey c_41,
t.productline c2,
t.productline c3s0,
t.productsubcategorykey c4,
t.productsubcategorykey c5s0
FROM
as_adventure.t1 t
WHERE
true
GROUP BY
2,
3,
4,
5 ) t_53
GROUP BY
4,
5,
6,
7 Above query only shows 8 records instead of 10 records. This is observed for the following versions: 5.7.6 5.8.5 5.9.3 5.10.2 5.11.2 5.12.2 5.13.1 5.14.0 5.14.4 5.15.1 5.16.2 6.0.1 6.1.1 6.2.0 6.3.1
... View more
Labels:
- Labels:
-
Apache Impala