Skip to content

Commit 9a57af9

Browse files
committed
Use PPL_SPEC in standalone ITs
Additionally: - Migrate CalcitePPLBasicIT to remote ITs - Delete CalcitePPLBasicPushdownIT since the remote ITs enable pushdown by default Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent 0f197e5 commit 9a57af9

26 files changed

Lines changed: 519 additions & 550 deletions

integ-test/src/test/java/org/opensearch/sql/calcite/standalone/CalcitePPLBasicIT.java renamed to integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBasicIT.java

Lines changed: 95 additions & 88 deletions
Large diffs are not rendered by default.

integ-test/src/test/java/org/opensearch/sql/calcite/standalone/CalciteArrayFunctionIT.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void testArrayLength() {
7272
+ " array_length(array) | head 1 | fields length",
7373
TEST_INDEX_BANK));
7474

75-
verifySchema(actual, schema("length", "integer"));
75+
verifySchema(actual, schema("length", "int"));
7676

7777
verifyDataRows(actual, rows(4));
7878
}
@@ -189,10 +189,7 @@ public void testReduce() {
189189
TEST_INDEX_BANK));
190190

191191
verifySchema(
192-
actual,
193-
schema("result", "integer"),
194-
schema("result2", "integer"),
195-
schema("result3", "double"));
192+
actual, schema("result", "int"), schema("result2", "int"), schema("result3", "double"));
196193

197194
verifyDataRows(actual, rows(6, 16, 60));
198195
}

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

Lines changed: 48 additions & 43 deletions
Large diffs are not rendered by default.

integ-test/src/test/java/org/opensearch/sql/calcite/standalone/CalcitePPLAppendcolIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public void testAppendCol() {
3636
actual,
3737
schema("gender", "string"),
3838
schema("state", "string"),
39-
schema("sum", "long"),
40-
schema("cnt", "long"));
39+
schema("sum", "bigint"),
40+
schema("cnt", "bigint"));
4141
verifyDataRows(
4242
actual,
4343
rows("F", "AK", 317, 493),
@@ -65,8 +65,8 @@ public void testAppendColOverride() {
6565
actual,
6666
schema("gender", "string"),
6767
schema("state", "string"),
68-
schema("sum", "long"),
69-
schema("cnt", "long"));
68+
schema("sum", "bigint"),
69+
schema("cnt", "bigint"));
7070
verifyDataRows(
7171
actual,
7272
rows("F", "AK", 317, 493),

integ-test/src/test/java/org/opensearch/sql/calcite/standalone/CalcitePPLBasicPushdownIT.java

Lines changed: 0 additions & 16 deletions
This file was deleted.

integ-test/src/test/java/org/opensearch/sql/calcite/standalone/CalcitePPLBuiltinFunctionIT.java

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ public void testSqrtAndCbrtAndPow() {
4040
+ " name, age, month",
4141
TEST_INDEX_STATE_COUNTRY));
4242

43-
verifySchema(
44-
actual, schema("name", "string"), schema("age", "integer"), schema("month", "integer"));
43+
verifySchema(actual, schema("name", "string"), schema("age", "int"), schema("month", "int"));
4544
verifyDataRows(actual, rows("Hello", 30, 4));
4645
}
4746

@@ -90,8 +89,7 @@ public void testAtanAndAtan2WithSort() {
9089
+ " fields name, age, month",
9190
TEST_INDEX_STATE_COUNTRY));
9291

93-
verifySchema(
94-
actual, schema("name", "string"), schema("age", "integer"), schema("month", "integer"));
92+
verifySchema(actual, schema("name", "string"), schema("age", "int"), schema("month", "int"));
9593
verifyDataRowsInOrder(actual, rows("Hello", 30, 4), rows("Jake", 70, 4));
9694
}
9795

@@ -139,7 +137,7 @@ public void testCeilingAndFloor() {
139137
"source=%s | where age = ceiling(29.7) and month = floor(4.9) | fields name, age",
140138
TEST_INDEX_STATE_COUNTRY));
141139

142-
verifySchema(actual, schema("name", "string"), schema("age", "integer"));
140+
verifySchema(actual, schema("name", "string"), schema("age", "int"));
143141
verifyDataRows(actual, rows("Hello", 30));
144142
}
145143

@@ -206,7 +204,7 @@ public void testCrc32AndAbs() {
206204
+ " | fields crc_name, name",
207205
TEST_INDEX_STATE_COUNTRY));
208206

209-
verifySchema(actual, schema("crc_name", "long"), schema("name", "string"));
207+
verifySchema(actual, schema("crc_name", "bigint"), schema("name", "string"));
210208
verifyDataRows(actual, rows(1516115372L, "Jane"));
211209
}
212210

@@ -230,7 +228,7 @@ public void testExpAndFloor() {
230228
"source=%s | where age = floor(exp(3.41)) | fields name, age",
231229
TEST_INDEX_STATE_COUNTRY));
232230

233-
verifySchema(actual, schema("name", "string"), schema("age", "integer"));
231+
verifySchema(actual, schema("name", "string"), schema("age", "int"));
234232
verifyDataRows(actual, rows("Hello", 30));
235233
}
236234

@@ -256,7 +254,7 @@ public void testModWithSortAndFields() {
256254
"source=%s | where mod(age, 10) = 0 | sort -age | fields name, age",
257255
TEST_INDEX_STATE_COUNTRY));
258256

259-
verifySchema(actual, schema("name", "string"), schema("age", "integer"));
257+
verifySchema(actual, schema("name", "string"), schema("age", "int"));
260258

261259
verifyDataRowsInOrder(actual, rows("Jake", 70), rows("Hello", 30), rows("Jane", 20));
262260
}
@@ -269,7 +267,7 @@ public void testModFloatAndNegative() {
269267
"source=%s | eval f = mod(float_number, 2), n = -1 * short_number %% 2, nd = -1 *"
270268
+ " double_number %% 2 | fields f, n, nd",
271269
TEST_INDEX_DATATYPE_NUMERIC));
272-
verifySchema(actual, schema("f", "float"), schema("n", "integer"), schema("nd", "double"));
270+
verifySchema(actual, schema("f", "float"), schema("n", "int"), schema("nd", "double"));
273271
verifyDataRows(actual, closeTo(0.2, -1, -1.1));
274272
}
275273

@@ -284,12 +282,12 @@ public void testModShouldReturnWiderTypes() {
284282
TEST_INDEX_DATATYPE_NUMERIC));
285283
verifySchema(
286284
actual,
287-
schema("b", "integer"),
288-
schema("i", "integer"),
289-
schema("l", "long"),
285+
schema("b", "int"),
286+
schema("i", "int"),
287+
schema("l", "bigint"),
290288
schema("f", "float"),
291289
schema("d", "double"),
292-
schema("s", "short"));
290+
schema("s", "smallint"));
293291
verifyDataRows(actual, closeTo(0, 2, 1, 0.2, 1.1, 3));
294292
}
295293

@@ -299,7 +297,7 @@ public void testModByZeroShouldReturnNull() {
299297
executeQuery(
300298
String.format(
301299
"source=%s | head 1 | eval z = mod(5, 0) | fields z", TEST_INDEX_STATE_COUNTRY));
302-
verifySchema(actual, schema("z", "integer"));
300+
verifySchema(actual, schema("z", "int"));
303301
verifyDataRows(actual, rows((Object) null));
304302
}
305303

@@ -349,7 +347,7 @@ public void testSignAndRound() {
349347
TEST_INDEX_STATE_COUNTRY));
350348

351349
verifySchema(
352-
actual, schema("name", "string"), schema("age", "integer"), schema("thirty_one", "double"));
350+
actual, schema("name", "string"), schema("age", "int"), schema("thirty_one", "double"));
353351
verifyDataRows(actual, rows("Hello", 30, 31));
354352
}
355353

@@ -366,10 +364,10 @@ public void testDivide() {
366364
TEST_INDEX_DATATYPE_NUMERIC));
367365
verifySchema(
368366
actual,
369-
schema("r1", "integer"),
370-
schema("r2", "integer"),
371-
schema("r3", "integer"),
372-
schema("r4", "short"),
367+
schema("r1", "int"),
368+
schema("r2", "int"),
369+
schema("r3", "int"),
370+
schema("r4", "smallint"),
373371
schema("r5", "float"),
374372
schema("r6", "float"),
375373
schema("r7", "double"),
@@ -404,8 +402,8 @@ public void testDivideShouldReturnNull() {
404402
verifySchema(
405403
actual,
406404
schema("r2", "double"),
407-
schema("r3", "integer"),
408-
schema("r4", "integer"),
405+
schema("r3", "int"),
406+
schema("r4", "int"),
409407
schema("r5", "double"),
410408
schema("r6", "double"));
411409
verifyDataRows(actual, rows(null, null, null, null, null));

0 commit comments

Comments
 (0)