Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private Plan normalize(LogicalProject<Plan> project) {
if (output instanceof WindowExpression) {
WindowExpression windowExpression = (WindowExpression) output;
Expression expression = ((WindowExpression) output).getFunction();
if (expression.containsType(OrderExpression.class)) {
if (expression.children().stream().anyMatch(OrderExpression.class::isInstance)) {
throw new AnalysisException("order by is not supported in " + expression);
}
if (expression instanceof NullableAggregateFunction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ suite("normalize_window_nullable_agg") {
exception "order by is not supported"
}

test {
sql "select group_concat(cast(sum(xwhat) over(partition by xwho order by xwhen) as varchar) order by xwhat) over(partition by xwhen) from windowfunnel_test_normalize_window;"
exception "order by is not supported"
}

// test only refuse order by in function's direct children
sql """
select sum(sum(xwhat) over(partition by xwho order by xwhen)) over(partition by xwho) from windowfunnel_test_normalize_window
"""

sql "set enable_fold_constant_by_be = 1;"
sql "drop table if exists fold_window1"
sql """create table fold_window1 (
Expand Down
Loading