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 @@ public Object result(PencentileApproAccumulator acc) {
float floatRet = (float) retValue;
return floatRet;
default:
return acc.value();
return retValue;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,26 @@ public void testStatsPercentile() throws IOException {
verifyDataRows(response, rows(32838));
}

@Test
public void testStatsPercentileWithMin() throws IOException {
JSONObject response =
executeQuery(
String.format(
"source=%s | eval decimal=ceil(balance/100000.0) | stats percentile(decimal, 50),"
+ " min(decimal)",
TEST_INDEX_BANK));
String returnType = "bigint";
if (isCalciteEnabled()) {
returnType = "double";
}

verifySchema(
response,
schema("percentile(decimal, 50)", null, returnType),
schema("min(decimal)", null, returnType));
verifyDataRows(response, rows(1, 1));
}

@Test
public void testStatsPercentileWithNull() throws IOException {
JSONObject response =
Expand Down
Loading