[Bug] [Vectorized] code dump on aggregate node over union node (#10040)

* miss check passthrough on vectorized

* format and add test

* update
This commit is contained in:
Pxl
2022-06-10 15:02:14 +08:00
committed by GitHub
parent 81a9284305
commit 495c34fa29
3 changed files with 17 additions and 0 deletions

View File

@ -284,9 +284,16 @@ public abstract class SetOperationNode extends PlanNode {
return false;
}
if (VectorizedUtil.isVectorized()) {
// On vectorized engine, we have more chance to do passthrough.
if (childSlotRef.getDesc().getSlotOffset() != setOpSlotRef.getDesc().getSlotOffset()) {
return false;
}
if (childSlotRef.isNullable() != setOpSlotRef.isNullable()) {
return false;
}
if (childSlotRef.getDesc().getType() != setOpSlotRef.getDesc().getType()) {
return false;
}
} else {
if (!childSlotRef.getDesc().layoutEquals(setOpSlotRef.getDesc())) {
return false;

View File

@ -20,3 +20,12 @@
8 255
9 1991
-- !select --
1985 1
1986 2
1989 2
1991 1
1992 1
255 1
32767 1

View File

@ -17,4 +17,5 @@
suite("test_union", "query") {
order_qt_select "select k1, k2 from test_query_db.baseall union select k2, k3 from test_query_db.test"
order_qt_select "select k2, count(k1) from ((select k2, avg(k1) k1 from test_query_db.baseall group by k2) union all (select k2, count(k1) k1 from test_query_db.test group by k2) )b group by k2 having k2 > 0 order by k2;"
}