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 @@ -383,6 +383,7 @@ struct PercentileState {
inited_flag = true;
vec_counts.resize(1);
vec_quantile.resize(1);
check_quantile(q);
vec_quantile[0] = q;
}
vec_counts[0].increment_batch(source);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,28 @@ suite("test_aggregate_all_functions", "arrow_flight_sql") {
assert("${ex}".contains("3000"))
}

sql """
drop table if exists percentile_input_no_nullable;
"""
sql """
create table percentile_input_no_nullable(a int, b int not null) properties ("replication_num" = "1");
"""
sql """
insert into percentile_input_no_nullable values (10, 100), (20,200), (30, 300), (40, 400);
"""

try {
sql " select percentile(b, -1) from percentile_input_no_nullable;"
} catch (Exception ex) {
assert("${ex}".contains("-1"))
}

try {
sql " select percentile(b, 3000) from percentile_input_no_nullable;"
} catch (Exception ex) {
assert("${ex}".contains("3000"))
}

sql "DROP TABLE IF EXISTS ${tableName_13}"


Expand Down
Loading