Skip to content

Commit e7e4bb5

Browse files
committed
Fix conflicts error
Signed-off-by: Lantao Jin <ltjin@amazon.com>
1 parent e0c5e95 commit e7e4bb5

4 files changed

Lines changed: 9 additions & 43 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public void testExplainWithReverse() throws IOException {
221221
public void testExplainWithTimechartAvg() throws IOException {
222222
var result = explainQueryToString("source=events | timechart span=1m avg(cpu_usage) by host");
223223
String expected =
224-
isPushdownEnabled()
224+
!isPushdownDisabled()
225225
? loadFromFile("expectedOutput/calcite/explain_timechart.json")
226226
: loadFromFile("expectedOutput/calcite/explain_timechart_no_pushdown.json");
227227
assertJsonEqualsIgnoreId(expected, result);
@@ -231,7 +231,7 @@ public void testExplainWithTimechartAvg() throws IOException {
231231
public void testExplainWithTimechartCount() throws IOException {
232232
var result = explainQueryToString("source=events | timechart span=1m count() by host");
233233
String expected =
234-
isPushdownEnabled()
234+
!isPushdownDisabled()
235235
? loadFromFile("expectedOutput/calcite/explain_timechart_count.json")
236236
: loadFromFile("expectedOutput/calcite/explain_timechart_count_no_pushdown.json");
237237
assertJsonEqualsIgnoreId(expected, result);

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void testPushdownSortPlusExpression() throws IOException {
4040
"source=%s | eval age2 = age + 2 | sort age2 | fields age | head 2",
4141
TEST_INDEX_BANK);
4242
String explained = explainQueryToString(ppl);
43-
if (isPushdownEnabled()) {
43+
if (!isPushdownDisabled()) {
4444
assertTrue(
4545
explained.contains(
4646
"[SORT->[{\\n"
@@ -63,7 +63,7 @@ public void testPushdownSortMinusExpression() throws IOException {
6363
"source=%s | eval age2 = 1 - age | sort age2 | fields age | head 2",
6464
TEST_INDEX_BANK);
6565
String explained = explainQueryToString(ppl);
66-
if (isPushdownEnabled()) {
66+
if (!isPushdownDisabled()) {
6767
assertTrue(
6868
explained.contains(
6969
"[SORT->[{\\n"
@@ -86,7 +86,7 @@ public void testPushdownSortTimesExpression() throws IOException {
8686
"source=%s | eval age2 = 5 * age | sort age2 | fields age | head 2",
8787
TEST_INDEX_BANK);
8888
String explained = explainQueryToString(ppl);
89-
if (isPushdownEnabled()) {
89+
if (!isPushdownDisabled()) {
9090
assertTrue(
9191
explained.contains(
9292
"[SORT->[{\\n"
@@ -109,7 +109,7 @@ public void testPushdownSortByMultiExpressions() throws IOException {
109109
"source=%s | eval age2 = 5 * age | sort gender, age2 | fields gender, age | head 2",
110110
TEST_INDEX_BANK);
111111
String explained = explainQueryToString(ppl);
112-
if (isPushdownEnabled()) {
112+
if (!isPushdownDisabled()) {
113113
assertTrue(
114114
explained.contains(
115115
"[SORT->[{\\n"
@@ -137,7 +137,7 @@ public void testPushdownSortCastExpression() throws IOException {
137137
"source=%s | eval age2 = cast(age * 5 as long) | sort age2 | fields age | head 2",
138138
TEST_INDEX_BANK);
139139
String explained = explainQueryToString(ppl);
140-
if (isPushdownEnabled()) {
140+
if (!isPushdownDisabled()) {
141141
assertTrue(
142142
explained.contains(
143143
"[SORT->[{\\n"
@@ -160,7 +160,7 @@ public void testPushdownSortCastToDoubleExpression() throws IOException {
160160
"source=%s | eval age2 = cast(age as double) | sort age2 | fields age, age2 | head 2",
161161
TEST_INDEX_BANK);
162162
String explained = explainQueryToString(ppl);
163-
if (isPushdownEnabled()) {
163+
if (!isPushdownDisabled()) {
164164
assertTrue(
165165
explained.contains(
166166
"SORT->[{\\n"

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

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -135,40 +135,6 @@ public List<?> getSettings() {
135135
};
136136
}
137137

138-
protected Settings enablePushdown() {
139-
System.out.println(Settings.Key.CALCITE_PUSHDOWN_ENABLED.name() + " enabled");
140-
return new Settings() {
141-
private final Map<Key, Object> defaultSettings =
142-
new ImmutableMap.Builder<Key, Object>()
143-
.put(Key.QUERY_SIZE_LIMIT, 200)
144-
.put(Key.SQL_CURSOR_KEEP_ALIVE, TimeValue.timeValueMinutes(1))
145-
.put(Key.FIELD_TYPE_TOLERANCE, true)
146-
.put(Key.CALCITE_ENGINE_ENABLED, true)
147-
.put(Key.CALCITE_FALLBACK_ALLOWED, false)
148-
.put(Key.CALCITE_PUSHDOWN_ENABLED, true)
149-
.put(Key.CALCITE_PUSHDOWN_ROWCOUNT_ESTIMATION_FACTOR, 0.9)
150-
.put(Key.PATTERN_METHOD, "SIMPLE_PATTERN")
151-
.put(Key.PATTERN_MODE, "LABEL")
152-
.put(Key.PATTERN_MAX_SAMPLE_COUNT, 10)
153-
.put(Key.PATTERN_BUFFER_LIMIT, 100000)
154-
.build();
155-
156-
@Override
157-
public <T> T getSettingValue(Key key) {
158-
return (T) defaultSettings.get(key);
159-
}
160-
161-
@Override
162-
public List<?> getSettings() {
163-
return (List<?>) defaultSettings;
164-
}
165-
};
166-
}
167-
168-
public boolean isPushdownEnabled() {
169-
return getSettings().getSettingValue(Settings.Key.CALCITE_PUSHDOWN_ENABLED);
170-
}
171-
172138
protected String execute(String query) {
173139
AtomicReference<String> actual = new AtomicReference<>();
174140
pplService.execute(

integ-test/src/test/java/org/opensearch/sql/ppl/PPLIntegTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public static class GlobalPushdownConfig {
257257
}
258258

259259
/**
260-
* Only check pushdown disabled instead enabled because enabled is the default value of pushdown
260+
* We check pushdown disabled instead enabled because enabled is the default value of pushdown
261261
* config whatever calcite is enabled or not.
262262
*/
263263
public boolean isPushdownDisabled() throws IOException {

0 commit comments

Comments
 (0)