leborchuk commented on code in PR #1754:
URL: https://github.com/apache/cloudberry/pull/1754#discussion_r3274706132
##########
src/backend/gpopt/translate/CTranslatorUtils.cpp:
##########
@@ -918,7 +918,7 @@ CTranslatorUtils::GetColumnAttnosForGroupBy(
case GROUPING_SET_EMPTY:
{
col_attnos_arr_current = GPOS_NEW(mp)
CBitSetArray(mp);
- CBitSet *bset = GPOS_NEW(mp) CBitSet(mp);
+ CBitSet *bset = GPOS_NEW(mp) CBitSet(mp,
num_cols);
Review Comment:
Here we fixed issue by setting the same BitSet size for all used bitsets.
But shouldn't we check if the sizes are equal in CBitSet::Union? Is it possible
to perform Union with bitsets of different sizes?
##########
src/test/regress/expected/groupingsets_optimizer.out:
##########
@@ -2645,4 +2645,18 @@ group by rollup (a,b) order by a;
| | 6
(8 rows)
+-- ORCA: rollup over a derived-expression group alias with a target-list SRF.
+select generate_series(1, a) g, a+b ab
+ from (values (1,1),(2,2)) t(a,b)
+ group by rollup(a, ab) order by 1,2;
Review Comment:
I checked also cube operation - it also returns 0 rows:
```
select generate_series(1, a) g, a+b ab
from (values (1,1),(2,2)) t(a,b)
group by cube(a, ab) order by 1,2;
g | ab
---+----
(0 rows)
```
Could we add also query with cube to regress tests for better coverage?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]