Skip to content

Commit d4d70c5

Browse files
author
Selina Song
committed
add no pushdown IT
Signed-off-by: Selina Song <[email protected]>
1 parent 3ff4fa5 commit d4d70c5

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,19 @@ public void testExplainWithReverse() throws IOException {
220220
public void testExplainWithReversePushdown() throws IOException {
221221
String query = "source=opensearch-sql_test_index_account | sort - age | reverse";
222222
var result = explainQueryToString(query);
223-
String expected = loadFromFile("expectedOutput/calcite/explain_reverse_pushdown_single.json");
223+
String expected = isPushdownEnabled()
224+
? loadFromFile("expectedOutput/calcite/explain_reverse_pushdown_single.json")
225+
: loadFromFile("expectedOutput/calcite_no_pushdown/explain_reverse_pushdown_single.json");
224226
assertJsonEqualsIgnoreId(expected, result);
225227
}
226228

227229
@Test
228230
public void testExplainWithReversePushdownMultipleFields() throws IOException {
229231
String query = "source=opensearch-sql_test_index_account | sort - age, + firstname | reverse";
230232
var result = explainQueryToString(query);
231-
String expected = loadFromFile("expectedOutput/calcite/explain_reverse_pushdown_multiple.json");
233+
String expected = isPushdownEnabled()
234+
? loadFromFile("expectedOutput/calcite/explain_reverse_pushdown_multiple.json")
235+
: loadFromFile("expectedOutput/calcite_no_pushdown/explain_reverse_pushdown_multiple.json");
232236
assertJsonEqualsIgnoreId(expected, result);
233237
}
234238

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"calcite": {
3+
"logical": "LogicalSystemLimit(sort0=[$8], sort1=[$1], dir0=[ASC-nulls-first], dir1=[DESC-nulls-last], fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(account_number=[$0], firstname=[$1], address=[$2], balance=[$3], gender=[$4], city=[$5], employer=[$6], state=[$7], age=[$8], email=[$9], lastname=[$10])\n LogicalSort(sort0=[$8], sort1=[$1], dir0=[ASC-nulls-first], dir1=[DESC-nulls-last])\n LogicalSort(sort0=[$8], sort1=[$1], dir0=[DESC-nulls-last], dir1=[ASC-nulls-first])\n CalciteLogicalIndexScan(table=[[OpenSearch, opensearch-sql_test_index_account]])\n",
4+
"physical": "EnumerableLimit(fetch=[10000])\n EnumerableSort(sort0=[$8], sort1=[$1], dir0=[ASC-nulls-first], dir1=[DESC-nulls-last])\n EnumerableCalc(expr#0..16=[{inputs}], proj#0..10=[{exprs}])\n CalciteEnumerableIndexScan(table=[[OpenSearch, opensearch-sql_test_index_account]])\n"
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"calcite": {
3+
"logical": "LogicalSystemLimit(sort0=[$8], dir0=[ASC-nulls-first], fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(account_number=[$0], firstname=[$1], address=[$2], balance=[$3], gender=[$4], city=[$5], employer=[$6], state=[$7], age=[$8], email=[$9], lastname=[$10])\n LogicalSort(sort0=[$8], dir0=[ASC-nulls-first])\n LogicalSort(sort0=[$8], dir0=[DESC-nulls-last])\n CalciteLogicalIndexScan(table=[[OpenSearch, opensearch-sql_test_index_account]])\n",
4+
"physical": "EnumerableLimit(fetch=[10000])\n EnumerableSort(sort0=[$8], dir0=[ASC-nulls-first])\n EnumerableCalc(expr#0..16=[{inputs}], proj#0..10=[{exprs}])\n CalciteEnumerableIndexScan(table=[[OpenSearch, opensearch-sql_test_index_account]])\n"
5+
}
6+
}

0 commit comments

Comments
 (0)