@@ -142,8 +142,8 @@ public void testLimitWithFilterPushdownExplain() throws Exception {
142142 public void testMultipleLimitExplain () throws Exception {
143143 String expected5Then10 =
144144 isCalciteEnabled ()
145- ? loadFromFile ("expectedOutput/calcite/explain_limit_5_10 .json" )
146- : loadFromFile ("expectedOutput/ppl/explain_limit_5_10 .json" );
145+ ? loadFromFile ("expectedOutput/calcite/explain_limit_5_10_push .json" )
146+ : loadFromFile ("expectedOutput/ppl/explain_limit_5_10_push .json" );
147147 assertJsonEqualsIgnoreRelId (
148148 expected5Then10 ,
149149 explainQueryToString (
@@ -154,8 +154,8 @@ public void testMultipleLimitExplain() throws Exception {
154154
155155 String expected10Then5 =
156156 isCalciteEnabled ()
157- ? loadFromFile ("expectedOutput/calcite/explain_limit_10_5 .json" )
158- : loadFromFile ("expectedOutput/ppl/explain_limit_10_5 .json" );
157+ ? loadFromFile ("expectedOutput/calcite/explain_limit_10_5_push .json" )
158+ : loadFromFile ("expectedOutput/ppl/explain_limit_10_5_push .json" );
159159 assertJsonEqualsIgnoreRelId (
160160 expected10Then5 ,
161161 explainQueryToString (
@@ -167,8 +167,8 @@ public void testMultipleLimitExplain() throws Exception {
167167 // The second limit should not be pushed down for limit-filter-limit queries
168168 String expected10ThenFilterThen5 =
169169 isCalciteEnabled ()
170- ? loadFromFile ("expectedOutput/calcite/explain_limit_10_filter_5 .json" )
171- : loadFromFile ("expectedOutput/ppl/explain_limit_10_filter_5 .json" );
170+ ? loadFromFile ("expectedOutput/calcite/explain_limit_10_filter_5_push .json" )
171+ : loadFromFile ("expectedOutput/ppl/explain_limit_10_filter_5_push .json" );
172172 assertJsonEqualsIgnoreRelId (
173173 expected10ThenFilterThen5 ,
174174 explainQueryToString (
@@ -179,6 +179,22 @@ public void testMultipleLimitExplain() throws Exception {
179179 + "| fields age" ));
180180 }
181181
182+ @ Test
183+ public void testLimitWithMultipleOffsetPushdownExplain () throws Exception {
184+ String expected =
185+ isCalciteEnabled ()
186+ ? loadFromFile ("expectedOutput/calcite/explain_limit_offsets_push.json" )
187+ : loadFromFile ("expectedOutput/ppl/explain_limit_offsets_push.json" );
188+
189+ assertJsonEqualsIgnoreRelId (
190+ expected ,
191+ explainQueryToString (
192+ "source=opensearch-sql_test_index_account"
193+ + "| head 10 from 1 "
194+ + "| head 5 from 2 "
195+ + "| fields age" ));
196+ }
197+
182198 @ Test
183199 public void testFillNullPushDownExplain () throws Exception {
184200 String expected = loadFromFile ("expectedOutput/ppl/explain_fillnull_push.json" );
0 commit comments