```sql
select a, c, sum(sum(b)) over(partition by c order by c rows between unbounded preceding and current row)
from test_window_table2 group by grouping sets((a),( c)) having a > 1 order by 1,2,3;
```
for this kind of case:
sum(sum(col)) over, nereids has cannot find slot problem.
the output slot of repeat and aggregate is computed wrongly.
Only collecting the trival-agg in NormalizeRepeat can fix this problem.
Co-authored-by: feiniaofeiafei <moailing@selectdb.com>
should not push down topn distinct through join when the output
columns of the corresponding child of join is more than
aggregate distinct columns.
for example for LEFT_OUTER_JOIN:
left child of join's output is: c1, c2, c3.
distinct columns is: c1, c2
topn: limit 2
if we push down topn distinct, we could get result of join like this:
```
c1 c2 c3, ...
1 2 1
1 2 2
```
and the final result we get is:
```
c1 c2
1 2
```
this is wrong, because we need 2 lines, but only return 1.
use dbId replace dbName, because dbName may be renamed by Alter.
procedure key add package name (only reserved, currently no plans to support package)
Optimize procedure create and exception
1. rename old create/drop table to add/removeMemoryTable
2. add new create/drop table/db method
3. support hms catalog create/drop table/db
(cherry picked from commit b2e869c7414c68186de8d43b324ae736d7cc3463)
for this kind of sql:
create table test_default10(
a int,
b varchar(100) default current_timestamp
)
distributed by hash(a)
properties('replication_num'="1");
add check:
Types other than DATETIME and DATETIMEV2 cannot use current_timestamp as the default value
this PR support slot appearing both in agg func and grouping sets.
sql like below:
select sum(a) from t group by grouping sets ((a));
Before this PR, Nereids throw exception like below:
col_int_undef_signed cannot both in select list and aggregate functions when using GROUPING SETS/CUBE/ROLLUP, please use union instead.
This PR removes the restriction and supports this situation.