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 @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package org.opensearch.sql.calcite.standalone;
package org.opensearch.sql.calcite.remote;

import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DATATYPE_NUMERIC;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DOG;
Expand All @@ -20,19 +20,23 @@
import java.io.IOException;
import org.json.JSONObject;
import org.junit.jupiter.api.Test;
import org.opensearch.sql.ppl.PPLIntegTestCase;

public class CalcitePPLBuiltinFunctionIT extends CalcitePPLIntegTestCase {
public class CalcitePPLBuiltinFunctionIT extends PPLIntegTestCase {
@Override
public void init() throws IOException {
public void init() throws Exception {
super.init();
enableCalcite();
disallowCalciteFallback();

loadIndex(Index.STATE_COUNTRY);
loadIndex(Index.DATA_TYPE_NUMERIC);
loadIndex(Index.DOG);
loadIndex(Index.NULL_MISSING);
}

@Test
public void testSqrtAndCbrtAndPow() {
public void testSqrtAndCbrtAndPow() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -45,7 +49,7 @@ public void testSqrtAndCbrtAndPow() {
}

@Test
public void testSqrtNegativeArgShouldReturnNull() {
public void testSqrtNegativeArgShouldReturnNull() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -55,7 +59,7 @@ public void testSqrtNegativeArgShouldReturnNull() {
}

@Test
public void testSinAndCosAndAsinAndAcos() {
public void testSinAndCosAndAsinAndAcos() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -68,7 +72,7 @@ public void testSinAndCosAndAsinAndAcos() {
}

@Test
public void testAsinAndAcosInvalidArgShouldReturnNull() {
public void testAsinAndAcosInvalidArgShouldReturnNull() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -81,7 +85,7 @@ public void testAsinAndAcosInvalidArgShouldReturnNull() {
}

@Test
public void testAtanAndAtan2WithSort() {
public void testAtanAndAtan2WithSort() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -94,7 +98,7 @@ public void testAtanAndAtan2WithSort() {
}

@Test
public void testTypeOfBasic() {
public void testTypeOfBasic() throws IOException {
JSONObject result =
executeQuery(
String.format(
Expand All @@ -116,7 +120,7 @@ public void testTypeOfBasic() {
result, rows("INT", "BOOLEAN", "DOUBLE", "STRING", "STRING", "STRING", "INT", "INTERVAL"));
}

public void testTypeOfDateTime() {
public void testTypeOfDateTime() throws IOException {
JSONObject result =
executeQuery(
String.format(
Expand All @@ -130,7 +134,7 @@ public void testTypeOfDateTime() {
}

@Test
public void testCeilingAndFloor() {
public void testCeilingAndFloor() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -142,7 +146,7 @@ public void testCeilingAndFloor() {
}

@Test
public void testConvAndLower() {
public void testConvAndLower() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -154,7 +158,7 @@ public void testConvAndLower() {
}

@Test
public void testConvNegateValue() {
public void testConvNegateValue() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -172,8 +176,8 @@ public void testConvNegateValue() {

@Test
public void testConvWithInvalidRadix() {
Exception invalidRadixException =
assertThrows(
Throwable invalidRadixException =
assertThrowsWithReplace(
NumberFormatException.class,
() ->
executeQuery(
Expand All @@ -184,7 +188,7 @@ public void testConvWithInvalidRadix() {
}

@Test
public void testPiAndCot() {
public void testPiAndCot() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -196,7 +200,7 @@ public void testPiAndCot() {
}

@Test
public void testCrc32AndAbs() {
public void testCrc32AndAbs() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -209,7 +213,7 @@ public void testCrc32AndAbs() {
}

@Test
public void testEAndLn() {
public void testEAndLn() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -221,7 +225,7 @@ public void testEAndLn() {
}

@Test
public void testExpAndFloor() {
public void testExpAndFloor() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -233,7 +237,7 @@ public void testExpAndFloor() {
}

@Test
public void testLogAndLog2AndLog10() {
public void testLogAndLog2AndLog10() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -247,7 +251,7 @@ public void testLogAndLog2AndLog10() {
}

@Test
public void testModWithSortAndFields() {
public void testModWithSortAndFields() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -260,7 +264,7 @@ public void testModWithSortAndFields() {
}

@Test
public void testModFloatAndNegative() {
public void testModFloatAndNegative() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -272,7 +276,7 @@ public void testModFloatAndNegative() {
}

@Test
public void testModShouldReturnWiderTypes() {
public void testModShouldReturnWiderTypes() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -292,7 +296,7 @@ public void testModShouldReturnWiderTypes() {
}

@Test
public void testModByZeroShouldReturnNull() {
public void testModByZeroShouldReturnNull() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -302,7 +306,7 @@ public void testModByZeroShouldReturnNull() {
}

@Test
public void testRadiansAndDegrees() {
public void testRadiansAndDegrees() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -314,7 +318,7 @@ public void testRadiansAndDegrees() {
}

@Test
public void testRand() {
public void testRand() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -326,7 +330,7 @@ public void testRand() {
}

@Test
public void testPowInvalidArgShouldReturnNull() {
public void testPowInvalidArgShouldReturnNull() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -338,7 +342,7 @@ public void testPowInvalidArgShouldReturnNull() {
}

@Test
public void testSignAndRound() {
public void testSignAndRound() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand All @@ -352,7 +356,7 @@ public void testSignAndRound() {
}

@Test
public void testDivide() {
public void testDivide() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand Down Expand Up @@ -392,7 +396,7 @@ public void testDivide() {
}

@Test
public void testDivideShouldReturnNull() {
public void testDivideShouldReturnNull() throws IOException {
JSONObject actual =
executeQuery(
String.format(
Expand Down
Loading
Loading