Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix](Nereids) fix fold const be return type #41164

Merged
merged 2 commits into from
Sep 27, 2024
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 @@ -66,7 +66,6 @@ public WindowExpression(Expression function, List<Expression> partitionKeys, Lis
.add(function)
.addAll(partitionKeys)
.addAll(orderKeys)
.add(windowFrame)
.build());
this.function = function;
this.partitionKeys = ImmutableList.copyOf(partitionKeys);
Expand Down Expand Up @@ -153,6 +152,9 @@ public WindowExpression withChildren(List<Expression> children) {
if (index < children.size()) {
return new WindowExpression(func, partitionKeys, orderKeys, (WindowFrame) children.get(index));
}
if (windowFrame.isPresent()) {
return new WindowExpression(func, partitionKeys, orderKeys, windowFrame.get());
}
return new WindowExpression(func, partitionKeys, orderKeys);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,29 @@ suite("fold_constant_by_be") {
sql("verbose select substring('123456', 1, 3)")
contains "varchar(3)"
}

sql "drop table if exists table_200_undef_partitions2_keys3_properties4_distributed_by53"
sql """create table table_200_undef_partitions2_keys3_properties4_distributed_by53 (
pk int,
col_char_255__undef_signed char(255) null ,
col_char_100__undef_signed char(100) null ,
col_char_255__undef_signed_not_null char(255) not null ,
col_char_100__undef_signed_not_null char(100) not null ,
col_varchar_255__undef_signed varchar(255) null ,
col_varchar_255__undef_signed_not_null varchar(255) not null ,
col_varchar_1000__undef_signed varchar(1000) null ,
col_varchar_1000__undef_signed_not_null varchar(1000) not null ,
col_varchar_1001__undef_signed varchar(1001) null ,
col_varchar_1001__undef_signed_not_null varchar(1001) not null
) engine=olap
DUPLICATE KEY(pk, col_char_255__undef_signed, col_char_100__undef_signed)
distributed by hash(pk) buckets 10
properties("replication_num" = "1");"""
explain {
sql("select LAST_VALUE(col_char_255__undef_signed_not_null, false) over (partition by " +
"concat('GkIPbzAZSu', col_char_100__undef_signed), mask('JrqFkEDqeA') " +
"order by pk rows between unbounded preceding and 6 following) AS col_alias26947 " +
"from table_200_undef_partitions2_keys3_properties4_distributed_by53;")
notContains("mask")
}
}
Loading