Skip to content

Commit 5338fce

Browse files
committed
Separate test cases and add an ignored IT
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent 5ffabfb commit 5338fce

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLAggregationIT.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.Arrays;
2323
import java.util.List;
2424
import org.json.JSONObject;
25+
import org.junit.Ignore;
2526
import org.junit.jupiter.api.Test;
2627
import org.opensearch.client.Request;
2728
import org.opensearch.sql.ppl.PPLIntegTestCase;
@@ -1182,10 +1183,28 @@ public void testStatsCountOnFunctionsWithUDTArg() throws IOException {
11821183
JSONObject response =
11831184
executeQuery(
11841185
String.format(
1185-
"source=%s | eval t = unix_timestamp(birthdate) | stats count() by t | sort t |"
1186-
+ " head 3",
1186+
"source=%s | eval t = unix_timestamp(birthdate) | stats count() by t | sort -t",
11871187
TEST_INDEX_BANK));
11881188
verifySchema(response, schema("count()", "bigint"), schema("t", "double"));
1189-
verifyDataRows(response, rows(1, 1508716800), rows(1, 1511136000), rows(1, 1529712000));
1189+
verifyDataRows(
1190+
response,
1191+
rows(1, 1542152000),
1192+
rows(1, 1534636800),
1193+
rows(1, 1533945600),
1194+
rows(1, 1530057600),
1195+
rows(1, 1529712000),
1196+
rows(1, 1511136000),
1197+
rows(1, 1508716800));
1198+
}
1199+
1200+
@Ignore("Enable after fixing https://github.com/opensearch-project/sql/issues/4296")
1201+
@Test
1202+
public void testLimitAfterAggregation() throws IOException {
1203+
JSONObject response =
1204+
executeQuery(
1205+
String.format(
1206+
"source=%s | stats count() by age | sort -age | head 3", TEST_INDEX_BANK));
1207+
verifySchema(response, schema("count()", "bigint"), schema("age", "int"));
1208+
verifyDataRows(response, rows(1, 39), rows(2, 36), rows(1, 34));
11901209
}
11911210
}

0 commit comments

Comments
 (0)