@@ -103,17 +103,17 @@ public void testJoinWithFieldList() throws IOException {
103103 String query =
104104 "source=opensearch-sql_test_index_bank | join type=outer account_number"
105105 + " opensearch-sql_test_index_bank" ;
106- var result = explainQueryToString (query );
106+ var result = explainQueryYaml (query );
107107 String expected = loadExpectedPlan ("explain_join_with_fields.yaml" );
108- assertYamlEqualsJsonIgnoreId (expected , result );
108+ assertYamlEqualsIgnoreId (expected , result );
109109 }
110110
111111 @ Test
112112 public void testExplainExistsUncorrelatedSubquery () throws IOException {
113113 String expected = loadExpectedPlan ("explain_exists_uncorrelated_subquery.yaml" );
114- assertYamlEqualsJsonIgnoreId (
114+ assertYamlEqualsIgnoreId (
115115 expected ,
116- explainQueryToString (
116+ explainQueryYaml (
117117 String .format (
118118 "source = %s"
119119 + "| where exists ["
@@ -127,9 +127,9 @@ public void testExplainExistsUncorrelatedSubquery() throws IOException {
127127 @ Test
128128 public void testExplainExistsCorrelatedSubquery () throws IOException {
129129 String expected = loadExpectedPlan ("explain_exists_correlated_subquery.yaml" );
130- assertYamlEqualsJsonIgnoreId (
130+ assertYamlEqualsIgnoreId (
131131 expected ,
132- explainQueryToString (
132+ explainQueryYaml (
133133 String .format (
134134 "source = %s"
135135 + "| where exists ["
@@ -143,9 +143,9 @@ public void testExplainExistsCorrelatedSubquery() throws IOException {
143143 @ Test
144144 public void testExplainInUncorrelatedSubquery () throws IOException {
145145 String expected = loadExpectedPlan ("explain_in_uncorrelated_subquery.yaml" );
146- assertYamlEqualsJsonIgnoreId (
146+ assertYamlEqualsIgnoreId (
147147 expected ,
148- explainQueryToString (
148+ explainQueryYaml (
149149 String .format (
150150 "source = %s"
151151 + "| where id in ["
@@ -159,9 +159,9 @@ public void testExplainInUncorrelatedSubquery() throws IOException {
159159 @ Test
160160 public void testExplainInCorrelatedSubquery () throws IOException {
161161 String expected = loadExpectedPlan ("explain_in_correlated_subquery.yaml" );
162- assertYamlEqualsJsonIgnoreId (
162+ assertYamlEqualsIgnoreId (
163163 expected ,
164- explainQueryToString (
164+ explainQueryYaml (
165165 String .format (
166166 "source = %s"
167167 + "| where name in ["
@@ -174,9 +174,9 @@ public void testExplainInCorrelatedSubquery() throws IOException {
174174 @ Test
175175 public void testExplainScalarUncorrelatedSubqueryInSelect () throws IOException {
176176 String expected = loadExpectedPlan ("explain_scalar_uncorrelated_subquery_in_select.yaml" );
177- assertYamlEqualsJsonIgnoreId (
177+ assertYamlEqualsIgnoreId (
178178 expected ,
179- explainQueryToString (
179+ explainQueryYaml (
180180 String .format (
181181 "source = %s"
182182 + "| eval count_dept = ["
@@ -189,9 +189,9 @@ public void testExplainScalarUncorrelatedSubqueryInSelect() throws IOException {
189189 @ Test
190190 public void testExplainScalarUncorrelatedSubqueryInWhere () throws IOException {
191191 String expected = loadExpectedPlan ("explain_scalar_uncorrelated_subquery_in_where.yaml" );
192- assertYamlEqualsJsonIgnoreId (
192+ assertYamlEqualsIgnoreId (
193193 expected ,
194- explainQueryToString (
194+ explainQueryYaml (
195195 String .format (
196196 "source = %s"
197197 + "| where id > ["
@@ -204,9 +204,9 @@ public void testExplainScalarUncorrelatedSubqueryInWhere() throws IOException {
204204 @ Test
205205 public void testExplainScalarCorrelatedSubqueryInSelect () throws IOException {
206206 String expected = loadExpectedPlan ("explain_scalar_correlated_subquery_in_select.yaml" );
207- assertYamlEqualsJsonIgnoreId (
207+ assertYamlEqualsIgnoreId (
208208 expected ,
209- explainQueryToString (
209+ explainQueryYaml (
210210 String .format (
211211 "source = %s"
212212 + "| eval count_dept = ["
@@ -220,9 +220,9 @@ public void testExplainScalarCorrelatedSubqueryInSelect() throws IOException {
220220 @ Test
221221 public void testExplainScalarCorrelatedSubqueryInWhere () throws IOException {
222222 String expected = loadExpectedPlan ("explain_scalar_correlated_subquery_in_where.yaml" );
223- assertYamlEqualsJsonIgnoreId (
223+ assertYamlEqualsIgnoreId (
224224 expected ,
225- explainQueryToString (
225+ explainQueryYaml (
226226 String .format (
227227 "source = %s"
228228 + "| where id = ["
@@ -238,9 +238,9 @@ public void supportPushDownSortMergeJoin() throws IOException {
238238 String query =
239239 "source=opensearch-sql_test_index_bank| join left=l right=r on"
240240 + " l.account_number=r.account_number opensearch-sql_test_index_bank" ;
241- var result = explainQueryToString (query );
241+ var result = explainQueryYaml (query );
242242 String expected = loadExpectedPlan ("explain_merge_join_sort_push.yaml" );
243- assertYamlEqualsJsonIgnoreId (expected , result );
243+ assertYamlEqualsIgnoreId (expected , result );
244244 }
245245
246246 // Only for Calcite
@@ -465,11 +465,11 @@ public void noPushDownForAggOnWindow() throws IOException {
465465 public void supportPushDownScriptOnTextField () throws IOException {
466466 enabledOnlyWhenPushdownIsEnabled ();
467467 String result =
468- explainQueryToString (
468+ explainQueryYaml (
469469 "explain source=opensearch-sql_test_index_account | where length(address) > 0 | eval"
470470 + " address_length = length(address) | stats count() by address_length" );
471471 String expected = loadFromFile ("expectedOutput/calcite/explain_script_push_on_text.yaml" );
472- assertYamlEqualsJsonIgnoreId (expected , result );
472+ assertYamlEqualsIgnoreId (expected , result );
473473 }
474474
475475 @ Test
@@ -838,9 +838,9 @@ public void testPushdownLimitIntoAggregation() throws IOException {
838838 + " from 10 " ));
839839
840840 expected = loadExpectedPlan ("explain_limit_agg_pushdown4.yaml" );
841- assertYamlEqualsJsonIgnoreId (
841+ assertYamlEqualsIgnoreId (
842842 expected ,
843- explainQueryToString (
843+ explainQueryYaml (
844844 "source=opensearch-sql_test_index_account | stats count() by state | sort state | head"
845845 + " 100 | head 10 from 10 " ));
846846
@@ -1091,9 +1091,9 @@ public void testExplainPushDownScriptsContainingUDT() throws IOException {
10911091 "source=%s | where cidrmatch(host, '0.0.0.0/24') | fields host" ,
10921092 TEST_INDEX_WEBLOGS )));
10931093
1094- assertYamlEqualsJsonIgnoreId (
1094+ assertYamlEqualsIgnoreId (
10951095 loadExpectedPlan ("explain_agg_script_timestamp_push.yaml" ),
1096- explainQueryToString (
1096+ explainQueryYaml (
10971097 String .format (
10981098 "source=%s | eval t = unix_timestamp(birthdate) | stats count() by t | sort t |"
10991099 + " head 3" ,
@@ -1124,9 +1124,9 @@ public void testJoinWithPushdownSortIntoAgg() throws IOException {
11241124 // PPL_JOIN_SUBSEARCH_MAXOUT!=0 will add limit before sort and then prevent sort push down.
11251125 setJoinSubsearchMaxOut (0 );
11261126 String expected = loadExpectedPlan ("explain_join_with_agg.yaml" );
1127- assertYamlEqualsJsonIgnoreId (
1127+ assertYamlEqualsIgnoreId (
11281128 expected ,
1129- explainQueryToString (
1129+ explainQueryYaml (
11301130 String .format (
11311131 "source=%s | stats COUNT() by age, gender | join left=L right=R ON L.gender ="
11321132 + " R.gender [source=%s | stats COUNT() as overall_cnt by gender]" ,
@@ -1137,9 +1137,9 @@ public void testJoinWithPushdownSortIntoAgg() throws IOException {
11371137 @ Test
11381138 public void testReplaceCommandExplain () throws IOException {
11391139 String expected = loadExpectedPlan ("explain_replace_command.yaml" );
1140- assertYamlEqualsJsonIgnoreId (
1140+ assertYamlEqualsIgnoreId (
11411141 expected ,
1142- explainQueryToString (
1142+ explainQueryYaml (
11431143 String .format (
11441144 "source=%s | replace 'IL' WITH 'Illinois' IN state | fields state" ,
11451145 TEST_INDEX_ACCOUNT )));
@@ -1150,9 +1150,9 @@ public void testReplaceCommandExplain() throws IOException {
11501150 public void testPushDownMinOrMaxAggOnDerivedField () throws IOException {
11511151 enabledOnlyWhenPushdownIsEnabled ();
11521152 String expected = loadExpectedPlan ("explain_min_max_agg_on_derived_field.yaml" );
1153- assertYamlEqualsJsonIgnoreId (
1153+ assertYamlEqualsIgnoreId (
11541154 expected ,
1155- explainQueryToString (
1155+ explainQueryYaml (
11561156 String .format (
11571157 "source=%s | eval balance2 = CEIL(balance/10000.0) "
11581158 + "| stats MIN(balance2), MAX(balance2)" ,
0 commit comments