Skip to content

Commit d4187d5

Browse files
authored
Merge pull request #2 from ishaoxy/migrate-it
migrate calcite IT and delete related pushdown IT
2 parents c1e930a + da2bb92 commit d4187d5

37 files changed

Lines changed: 346 additions & 607 deletions

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

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package org.opensearch.sql.calcite.standalone;
6+
package org.opensearch.sql.calcite.remote;
77

88
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DATATYPE_NUMERIC;
99
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DOG;
@@ -20,19 +20,23 @@
2020
import java.io.IOException;
2121
import org.json.JSONObject;
2222
import org.junit.jupiter.api.Test;
23+
import org.opensearch.sql.ppl.PPLIntegTestCase;
2324

24-
public class CalcitePPLBuiltinFunctionIT extends CalcitePPLIntegTestCase {
25+
public class CalcitePPLBuiltinFunctionIT extends PPLIntegTestCase {
2526
@Override
26-
public void init() throws IOException {
27+
public void init() throws Exception {
2728
super.init();
29+
enableCalcite();
30+
disallowCalciteFallback();
31+
2832
loadIndex(Index.STATE_COUNTRY);
2933
loadIndex(Index.DATA_TYPE_NUMERIC);
3034
loadIndex(Index.DOG);
3135
loadIndex(Index.NULL_MISSING);
3236
}
3337

3438
@Test
35-
public void testSqrtAndCbrtAndPow() {
39+
public void testSqrtAndCbrtAndPow() throws IOException {
3640
JSONObject actual =
3741
executeQuery(
3842
String.format(
@@ -45,7 +49,7 @@ public void testSqrtAndCbrtAndPow() {
4549
}
4650

4751
@Test
48-
public void testSqrtNegativeArgShouldReturnNull() {
52+
public void testSqrtNegativeArgShouldReturnNull() throws IOException {
4953
JSONObject actual =
5054
executeQuery(
5155
String.format(
@@ -55,7 +59,7 @@ public void testSqrtNegativeArgShouldReturnNull() {
5559
}
5660

5761
@Test
58-
public void testSinAndCosAndAsinAndAcos() {
62+
public void testSinAndCosAndAsinAndAcos() throws IOException {
5963
JSONObject actual =
6064
executeQuery(
6165
String.format(
@@ -68,7 +72,7 @@ public void testSinAndCosAndAsinAndAcos() {
6872
}
6973

7074
@Test
71-
public void testAsinAndAcosInvalidArgShouldReturnNull() {
75+
public void testAsinAndAcosInvalidArgShouldReturnNull() throws IOException {
7276
JSONObject actual =
7377
executeQuery(
7478
String.format(
@@ -81,7 +85,7 @@ public void testAsinAndAcosInvalidArgShouldReturnNull() {
8185
}
8286

8387
@Test
84-
public void testAtanAndAtan2WithSort() {
88+
public void testAtanAndAtan2WithSort() throws IOException {
8589
JSONObject actual =
8690
executeQuery(
8791
String.format(
@@ -94,7 +98,7 @@ public void testAtanAndAtan2WithSort() {
9498
}
9599

96100
@Test
97-
public void testTypeOfBasic() {
101+
public void testTypeOfBasic() throws IOException {
98102
JSONObject result =
99103
executeQuery(
100104
String.format(
@@ -116,7 +120,7 @@ public void testTypeOfBasic() {
116120
result, rows("INT", "BOOLEAN", "DOUBLE", "STRING", "STRING", "STRING", "INT", "INTERVAL"));
117121
}
118122

119-
public void testTypeOfDateTime() {
123+
public void testTypeOfDateTime() throws IOException {
120124
JSONObject result =
121125
executeQuery(
122126
String.format(
@@ -130,7 +134,7 @@ public void testTypeOfDateTime() {
130134
}
131135

132136
@Test
133-
public void testCeilingAndFloor() {
137+
public void testCeilingAndFloor() throws IOException {
134138
JSONObject actual =
135139
executeQuery(
136140
String.format(
@@ -142,7 +146,7 @@ public void testCeilingAndFloor() {
142146
}
143147

144148
@Test
145-
public void testConvAndLower() {
149+
public void testConvAndLower() throws IOException {
146150
JSONObject actual =
147151
executeQuery(
148152
String.format(
@@ -154,7 +158,7 @@ public void testConvAndLower() {
154158
}
155159

156160
@Test
157-
public void testConvNegateValue() {
161+
public void testConvNegateValue() throws IOException {
158162
JSONObject actual =
159163
executeQuery(
160164
String.format(
@@ -172,8 +176,8 @@ public void testConvNegateValue() {
172176

173177
@Test
174178
public void testConvWithInvalidRadix() {
175-
Exception invalidRadixException =
176-
assertThrows(
179+
Throwable invalidRadixException =
180+
assertThrowsWithReplace(
177181
NumberFormatException.class,
178182
() ->
179183
executeQuery(
@@ -184,7 +188,7 @@ public void testConvWithInvalidRadix() {
184188
}
185189

186190
@Test
187-
public void testPiAndCot() {
191+
public void testPiAndCot() throws IOException {
188192
JSONObject actual =
189193
executeQuery(
190194
String.format(
@@ -196,7 +200,7 @@ public void testPiAndCot() {
196200
}
197201

198202
@Test
199-
public void testCrc32AndAbs() {
203+
public void testCrc32AndAbs() throws IOException {
200204
JSONObject actual =
201205
executeQuery(
202206
String.format(
@@ -209,7 +213,7 @@ public void testCrc32AndAbs() {
209213
}
210214

211215
@Test
212-
public void testEAndLn() {
216+
public void testEAndLn() throws IOException {
213217
JSONObject actual =
214218
executeQuery(
215219
String.format(
@@ -221,7 +225,7 @@ public void testEAndLn() {
221225
}
222226

223227
@Test
224-
public void testExpAndFloor() {
228+
public void testExpAndFloor() throws IOException {
225229
JSONObject actual =
226230
executeQuery(
227231
String.format(
@@ -233,7 +237,7 @@ public void testExpAndFloor() {
233237
}
234238

235239
@Test
236-
public void testLogAndLog2AndLog10() {
240+
public void testLogAndLog2AndLog10() throws IOException {
237241
JSONObject actual =
238242
executeQuery(
239243
String.format(
@@ -247,7 +251,7 @@ public void testLogAndLog2AndLog10() {
247251
}
248252

249253
@Test
250-
public void testModWithSortAndFields() {
254+
public void testModWithSortAndFields() throws IOException {
251255
JSONObject actual =
252256
executeQuery(
253257
String.format(
@@ -260,7 +264,7 @@ public void testModWithSortAndFields() {
260264
}
261265

262266
@Test
263-
public void testModFloatAndNegative() {
267+
public void testModFloatAndNegative() throws IOException {
264268
JSONObject actual =
265269
executeQuery(
266270
String.format(
@@ -272,7 +276,7 @@ public void testModFloatAndNegative() {
272276
}
273277

274278
@Test
275-
public void testModShouldReturnWiderTypes() {
279+
public void testModShouldReturnWiderTypes() throws IOException {
276280
JSONObject actual =
277281
executeQuery(
278282
String.format(
@@ -292,7 +296,7 @@ public void testModShouldReturnWiderTypes() {
292296
}
293297

294298
@Test
295-
public void testModByZeroShouldReturnNull() {
299+
public void testModByZeroShouldReturnNull() throws IOException {
296300
JSONObject actual =
297301
executeQuery(
298302
String.format(
@@ -302,7 +306,7 @@ public void testModByZeroShouldReturnNull() {
302306
}
303307

304308
@Test
305-
public void testRadiansAndDegrees() {
309+
public void testRadiansAndDegrees() throws IOException {
306310
JSONObject actual =
307311
executeQuery(
308312
String.format(
@@ -314,7 +318,7 @@ public void testRadiansAndDegrees() {
314318
}
315319

316320
@Test
317-
public void testRand() {
321+
public void testRand() throws IOException {
318322
JSONObject actual =
319323
executeQuery(
320324
String.format(
@@ -326,7 +330,7 @@ public void testRand() {
326330
}
327331

328332
@Test
329-
public void testPowInvalidArgShouldReturnNull() {
333+
public void testPowInvalidArgShouldReturnNull() throws IOException {
330334
JSONObject actual =
331335
executeQuery(
332336
String.format(
@@ -338,7 +342,7 @@ public void testPowInvalidArgShouldReturnNull() {
338342
}
339343

340344
@Test
341-
public void testSignAndRound() {
345+
public void testSignAndRound() throws IOException {
342346
JSONObject actual =
343347
executeQuery(
344348
String.format(
@@ -352,7 +356,7 @@ public void testSignAndRound() {
352356
}
353357

354358
@Test
355-
public void testDivide() {
359+
public void testDivide() throws IOException {
356360
JSONObject actual =
357361
executeQuery(
358362
String.format(
@@ -392,7 +396,7 @@ public void testDivide() {
392396
}
393397

394398
@Test
395-
public void testDivideShouldReturnNull() {
399+
public void testDivideShouldReturnNull() throws IOException {
396400
JSONObject actual =
397401
executeQuery(
398402
String.format(

0 commit comments

Comments
 (0)