Skip to content

Commit 4ac2b46

Browse files
committed
optimize it
Signed-off-by: xinyual <xinyual@amazon.com>
1 parent 17f4ac0 commit 4ac2b46

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

integ-test/src/test/java/org/opensearch/sql/ppl/StatsCommandIT.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,12 +613,19 @@ public void testStatsPercentileWithMin() throws IOException {
613613
JSONObject response =
614614
executeQuery(
615615
String.format(
616-
"source=%s | stats percentile(balance, 50), min(balance)", TEST_INDEX_BANK));
616+
"source=%s | eval decimal=ceil(balance/100000.0) | stats percentile(decimal, 50),"
617+
+ " min(decimal)",
618+
TEST_INDEX_BANK));
619+
String returnType = "bigint";
620+
if (isCalciteEnabled()) {
621+
returnType = "double";
622+
}
623+
617624
verifySchema(
618625
response,
619-
schema("percentile(balance, 50)", null, "bigint"),
620-
schema("min(balance)", null, "bigint"));
621-
verifyDataRows(response, rows(32838, 4180));
626+
schema("percentile(decimal, 50)", null, returnType),
627+
schema("min(decimal)", null, returnType));
628+
verifyDataRows(response, rows(1, 1));
622629
}
623630

624631
@Test

0 commit comments

Comments
 (0)