Skip to content

Commit 2d33f53

Browse files
Use pagination in correctess tests too.
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
1 parent e2d2c54 commit 2d33f53

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

integ-test/src/test/java/org/opensearch/sql/correctness/runner/connection/JDBCConnection.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ public void insert(String tableName, String[] columnNames, List<Object[]> batch)
118118

119119
@Override
120120
public DBResult select(String query) {
121-
try (Statement stmt = connection.createStatement()) {
121+
try (Statement stmt =
122+
connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY)) {
123+
stmt.setFetchSize(5);
122124
ResultSet resultSet = stmt.executeQuery(query);
123125
DBResult result = isOrderByQuery(query)
124126
? DBResult.resultInOrder(databaseName) : DBResult.result(databaseName);

integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ protected static JSONObject updateClusterSettings(ClusterSetting setting, RestCl
384384
return new JSONObject(executeRequest(request, client));
385385
}
386386

387-
protected static JSONObject updateClusterSettings(ClusterSetting setting) throws IOException {
387+
public static JSONObject updateClusterSettings(ClusterSetting setting) throws IOException {
388388
return updateClusterSettings(setting, client());
389389
}
390390

@@ -396,7 +396,7 @@ protected static JSONObject getAllClusterSettings() throws IOException {
396396
return new JSONObject(executeRequest(request));
397397
}
398398

399-
protected static class ClusterSetting {
399+
public static class ClusterSetting {
400400
private final String type;
401401
private final String name;
402402
private final String value;

integ-test/src/test/java/org/opensearch/sql/sql/SQLCorrectnessIT.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66

77
package org.opensearch.sql.sql;
88

9+
import static org.opensearch.sql.legacy.SQLIntegTestCase.PERSISTENT;
10+
import static org.opensearch.sql.legacy.SQLIntegTestCase.updateClusterSettings;
11+
912
import com.google.common.io.Resources;
1013
import java.io.IOException;
1114
import java.nio.file.Files;
1215
import java.nio.file.Path;
1316
import java.nio.file.Paths;
1417
import java.util.function.Function;
1518
import org.junit.Test;
19+
import org.opensearch.sql.common.setting.Settings;
20+
import org.opensearch.sql.legacy.SQLIntegTestCase;
1621

1722
/**
1823
* SQL integration test automated by comparison test framework.
@@ -26,6 +31,11 @@ public class SQLCorrectnessIT extends CorrectnessTestBase {
2631
@Override
2732
protected void init() throws Exception {
2833
super.init();
34+
updateClusterSettings(
35+
new SQLIntegTestCase.ClusterSetting(
36+
PERSISTENT,
37+
Settings.Key.IGNORE_UNSUPPORTED_PAGINATION.getKeyValue(),
38+
"true"));
2939
}
3040

3141
@Test

0 commit comments

Comments
 (0)