Skip to content

Commit aa67346

Browse files
committed
Stabilize more PPL ITs on the analytics-engine route
Extends the analytics-route parity pass to six more test classes, all test-only: - CalcitePPLStringBuiltinFunctionIT: 7 tests re-PUT a shared _id with different data (testConcatWithField/ConcatWs/Reverse/Right/Trim/RTrim/LTrim). The append-only AE store can't replace docs (DELETE unsupported), so they accumulate/cross-contaminate. Skipped via DOC_MUTATION. - MultiMatchIT/QueryStringIT/SimpleQueryStringIT wildcard tests: multi_match / query_string / simple_query_string are full-text relevance functions with no DataFusion equivalent (return no rows). New FULLTEXT_RELEVANCE_FUNC. - CalciteLikeQueryIT.test_the_default_3rd_option: LIKE is case-insensitive on the AE route (DataFusion) but case-sensitive on v2/Calcite. New LIKE_CASE_SENSITIVITY. - CalcitePPLAppendPipeCommandIT.testDoubleAppendPipeWithFilter: appendpipe drops the main pipeline's rows on the AE route (subpipe filter applied in place). New APPENDPIPE_MAIN_RESULT_DROPPED. - DataTypeIT excludes (test_nonnumeric_data_types, test_alias_data_type, SystemFunctionIT.typeof_opensearch_types): broaden the existing org.opensearch.sql.ppl.* globs to '*' so they also cover the Calcite subclasses (CalciteDataTypeIT, CalciteSystemFunctionIT). Each skipped test carries an in-test assumeNotAnalytics(...) plus a matching excludeTestsMatching entry. v2/Calcite route unchanged (all run, 0 skips). Signed-off-by: Kai Huang <ahkcs@amazon.com>
1 parent ad0121c commit aa67346

8 files changed

Lines changed: 86 additions & 4 deletions

File tree

integ-test/build.gradle

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,10 +1075,11 @@ task integTestRemote(type: RestIntegTestTask) {
10751075
// GeoPointFormatsIT: EVERY test reads a geo_point field — whole class doomed.
10761076
excludeTestsMatching 'org.opensearch.sql.ppl.GeoPointFormatsIT'
10771077
// datatypes_index_mapping: nested_value=nested, geo_point_value=geo_point.
1078-
excludeTestsMatching 'org.opensearch.sql.ppl.DataTypeIT.test_nonnumeric_data_types'
1079-
excludeTestsMatching 'org.opensearch.sql.ppl.SystemFunctionIT.typeof_opensearch_types'
1078+
// Glob matches the Calcite subclasses too (CalciteDataTypeIT, CalciteSystemFunctionIT).
1079+
excludeTestsMatching '*DataTypeIT.test_nonnumeric_data_types'
1080+
excludeTestsMatching '*SystemFunctionIT.typeof_opensearch_types'
10801081
// alias_index_mapping: alias_col is type=alias; query is `where alias_col > 1`.
1081-
excludeTestsMatching 'org.opensearch.sql.ppl.DataTypeIT.test_alias_data_type'
1082+
excludeTestsMatching '*DataTypeIT.test_alias_data_type'
10821083
// CalciteAliasFieldAggregationIT: raw-PUT alias index can't be created on the AE route
10831084
// and every test queries alias fields directly — whole class doomed.
10841085
excludeTestsMatching 'org.opensearch.sql.calcite.remote.CalciteAliasFieldAggregationIT'
@@ -1180,6 +1181,29 @@ task integTestRemote(type: RestIntegTestTask) {
11801181
// === Excludes: CalcitePPLCaseFunctionIT route divergences ===
11811182
// bin @timestamp then group by it: bucket column typed string (not timestamp) on AE.
11821183
excludeTestsMatching '*CalcitePPLCaseFunctionIT.testNestedCaseAggWithAutoDateHistogram'
1184+
1185+
// === Excludes: CalcitePPLStringBuiltinFunctionIT route divergences ===
1186+
// Re-PUT a shared _id with different data; the append-only AE store can't replace docs.
1187+
excludeTestsMatching '*CalcitePPLStringBuiltinFunctionIT.testConcatWithField'
1188+
excludeTestsMatching '*CalcitePPLStringBuiltinFunctionIT.testConcatWs'
1189+
excludeTestsMatching '*CalcitePPLStringBuiltinFunctionIT.testReverse'
1190+
excludeTestsMatching '*CalcitePPLStringBuiltinFunctionIT.testRight'
1191+
excludeTestsMatching '*CalcitePPLStringBuiltinFunctionIT.testTrim'
1192+
excludeTestsMatching '*CalcitePPLStringBuiltinFunctionIT.testRTrim'
1193+
excludeTestsMatching '*CalcitePPLStringBuiltinFunctionIT.testLTrim'
1194+
1195+
// === Excludes: full-text relevance functions (unsupported on DataFusion) ===
1196+
excludeTestsMatching '*MultiMatchIT.test_wildcard_multi_match'
1197+
excludeTestsMatching '*QueryStringIT.wildcard_test'
1198+
excludeTestsMatching '*SimpleQueryStringIT.test_wildcard_simple_query_string'
1199+
1200+
// === Excludes: CalciteLikeQueryIT route divergence ===
1201+
// LIKE is case-insensitive on AE (DataFusion); v2/Calcite treats LIKE as case-sensitive.
1202+
excludeTestsMatching '*CalciteLikeQueryIT.test_the_default_3rd_option'
1203+
1204+
// === Excludes: CalcitePPLAppendPipeCommandIT route divergence ===
1205+
// appendpipe drops the main pipeline's rows on AE (subpipe filter applied in place).
1206+
excludeTestsMatching '*CalcitePPLAppendPipeCommandIT.testDoubleAppendPipeWithFilter'
11831207
}
11841208
}
11851209

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package org.opensearch.sql.calcite.remote;
77

88
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_WILDCARD;
9+
import static org.opensearch.sql.util.AnalyticsRouteLimitation.LIKE_CASE_SENSITIVITY;
910
import static org.opensearch.sql.util.MatcherUtils.rows;
1011
import static org.opensearch.sql.util.MatcherUtils.verifyDataRows;
1112
import static org.opensearch.sql.util.MatcherUtils.verifyNumOfRows;
@@ -51,6 +52,8 @@ public void test_ilike_is_case_insensitive() throws IOException {
5152
@Test
5253
public void test_the_default_3rd_option() throws IOException {
5354
// only work in v3
55+
// case-sensitive LIKE (legacy=false) expects 0 rows; AE LIKE is case-insensitive and returns 7.
56+
assumeNotAnalytics(LIKE_CASE_SENSITIVITY);
5457
String query =
5558
"source="
5659
+ TEST_INDEX_WILDCARD

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_ACCOUNT;
99
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_BANK;
10+
import static org.opensearch.sql.util.AnalyticsRouteLimitation.APPENDPIPE_MAIN_RESULT_DROPPED;
1011
import static org.opensearch.sql.util.MatcherUtils.rows;
1112
import static org.opensearch.sql.util.MatcherUtils.schema;
1213
import static org.opensearch.sql.util.MatcherUtils.verifyDataRows;
@@ -146,6 +147,8 @@ public void testTripleAppendPipe() throws IOException {
146147
/** Regression test: double appendpipe with non-aggregation (filter) subpipeline. */
147148
@Test
148149
public void testDoubleAppendPipeWithFilter() throws IOException {
150+
// appendpipe drops the main pipeline's rows on the AE route (filter applied in place).
151+
assumeNotAnalytics(APPENDPIPE_MAIN_RESULT_DROPPED);
149152
JSONObject actual =
150153
executeQuery(
151154
String.format(

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_ACCOUNT;
99
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_STATE_COUNTRY;
1010
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_STATE_COUNTRY_WITH_NULL;
11+
import static org.opensearch.sql.util.AnalyticsRouteLimitation.DOC_MUTATION;
1112
import static org.opensearch.sql.util.MatcherUtils.*;
1213
import static org.opensearch.sql.util.MatcherUtils.rows;
1314

@@ -61,6 +62,8 @@ public void testConcat() throws IOException {
6162

6263
@Test
6364
public void testConcatWithField() throws IOException {
65+
// Re-PUTs a shared _id with different data; the append-only AE store can't replace it.
66+
assumeNotAnalytics(DOC_MUTATION);
6467
Request request1 =
6568
new Request("PUT", "/opensearch-sql_test_index_state_country/_doc/5?refresh=true");
6669
request1.setJsonEntity(
@@ -79,6 +82,8 @@ public void testConcatWithField() throws IOException {
7982

8083
@Test
8184
public void testConcatWs() throws IOException {
85+
// Re-PUTs a shared _id with different data; the append-only AE store can't replace it.
86+
assumeNotAnalytics(DOC_MUTATION);
8287
Request request1 =
8388
new Request("PUT", "/opensearch-sql_test_index_state_country/_doc/5?refresh=true");
8489
request1.setJsonEntity(
@@ -213,6 +218,8 @@ public void testPosition() throws IOException {
213218

214219
@Test
215220
public void testTrim() throws IOException {
221+
// Re-PUTs a shared _id with different data; the append-only AE store can't replace it.
222+
assumeNotAnalytics(DOC_MUTATION);
216223
prepareTrim();
217224
JSONObject actual =
218225
executeQuery(
@@ -227,6 +234,8 @@ public void testTrim() throws IOException {
227234

228235
@Test
229236
public void testRTrim() throws IOException {
237+
// Re-PUTs a shared _id with different data; the append-only AE store can't replace it.
238+
assumeNotAnalytics(DOC_MUTATION);
230239
prepareTrim();
231240
JSONObject actual =
232241
executeQuery(
@@ -241,6 +250,8 @@ public void testRTrim() throws IOException {
241250

242251
@Test
243252
public void testLTrim() throws IOException {
253+
// Re-PUTs a shared _id with different data; the append-only AE store can't replace it.
254+
assumeNotAnalytics(DOC_MUTATION);
244255
prepareTrim();
245256
JSONObject actual =
246257
executeQuery(
@@ -255,6 +266,8 @@ public void testLTrim() throws IOException {
255266

256267
@Test
257268
public void testReverse() throws IOException {
269+
// Re-PUTs a shared _id with different data; the append-only AE store can't replace it.
270+
assumeNotAnalytics(DOC_MUTATION);
258271
Request request1 =
259272
new Request("PUT", "/opensearch-sql_test_index_state_country/_doc/5?refresh=true");
260273
request1.setJsonEntity(
@@ -273,6 +286,8 @@ public void testReverse() throws IOException {
273286

274287
@Test
275288
public void testRight() throws IOException {
289+
// Re-PUTs a shared _id with different data; the append-only AE store can't replace it.
290+
assumeNotAnalytics(DOC_MUTATION);
276291
Request request1 =
277292
new Request("PUT", "/opensearch-sql_test_index_state_country/_doc/5?refresh=true");
278293
request1.setJsonEntity(

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package org.opensearch.sql.ppl;
77

88
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_BEER;
9+
import static org.opensearch.sql.util.AnalyticsRouteLimitation.FULLTEXT_RELEVANCE_FUNC;
910

1011
import java.io.IOException;
1112
import org.json.JSONObject;
@@ -46,6 +47,8 @@ public void test_multi_match_all_params() throws IOException {
4647

4748
@Test
4849
public void test_wildcard_multi_match() throws IOException {
50+
// multi_match/query_string/simple_query_string: full-text relevance, unsupported on AE.
51+
assumeNotAnalytics(FULLTEXT_RELEVANCE_FUNC);
4952
String query1 =
5053
"SOURCE=" + TEST_INDEX_BEER + " | WHERE multi_match(['Tags'], 'taste') | fields Id";
5154
var result1 = executeQuery(query1);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package org.opensearch.sql.ppl;
77

88
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_BEER;
9+
import static org.opensearch.sql.util.AnalyticsRouteLimitation.FULLTEXT_RELEVANCE_FUNC;
910

1011
import java.io.IOException;
1112
import org.json.JSONObject;
@@ -57,6 +58,8 @@ public void all_params_test() throws IOException {
5758

5859
@Test
5960
public void wildcard_test() throws IOException {
61+
// multi_match/query_string/simple_query_string: full-text relevance, unsupported on AE.
62+
assumeNotAnalytics(FULLTEXT_RELEVANCE_FUNC);
6063

6164
String query1 = "source=" + TEST_INDEX_BEER + " | where query_string(['Tags'], 'taste')";
6265
JSONObject result1 = executeQuery(query1);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package org.opensearch.sql.ppl;
77

88
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_BEER;
9+
import static org.opensearch.sql.util.AnalyticsRouteLimitation.FULLTEXT_RELEVANCE_FUNC;
910

1011
import java.io.IOException;
1112
import org.json.JSONObject;
@@ -46,6 +47,8 @@ public void test_simple_query_string_all_params() throws IOException {
4647

4748
@Test
4849
public void test_wildcard_simple_query_string() throws IOException {
50+
// multi_match/query_string/simple_query_string: full-text relevance, unsupported on AE.
51+
assumeNotAnalytics(FULLTEXT_RELEVANCE_FUNC);
4952
String query1 =
5053
"SOURCE=" + TEST_INDEX_BEER + " | WHERE simple_query_string(['Tags'], 'taste') | fields Id";
5154
var result1 = executeQuery(query1);

integ-test/src/test/java/org/opensearch/sql/util/AnalyticsRouteLimitation.java

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,35 @@ public enum AnalyticsRouteLimitation {
192192
EVAL_MAX_MIN_INT_WIDENING(
193193
"eval max()/min() over integer operands reports the result column as bigint on the"
194194
+ " analytics-engine route (DataFusion widens integers to Int64), whereas the v2/Calcite"
195-
+ " path reports int.");
195+
+ " path reports int."),
196+
197+
/**
198+
* Lucene full-text relevance functions ({@code match}, {@code multi_match}, {@code query_string},
199+
* {@code simple_query_string}, …) are unsupported on the analytics-engine route — DataFusion has
200+
* no relevance scorer, so a query that filters on one returns no rows.
201+
*/
202+
FULLTEXT_RELEVANCE_FUNC(
203+
"Full-text relevance functions (match/multi_match/query_string/simple_query_string) are"
204+
+ " unsupported on the analytics-engine route: DataFusion has no relevance scorer, so the"
205+
+ " filter returns no rows."),
206+
207+
/**
208+
* LIKE is case-insensitive on the analytics-engine route (DataFusion), whereas the v2/Calcite
209+
* path treats {@code LIKE} as case-sensitive (only {@code ILIKE} is case-insensitive).
210+
*/
211+
LIKE_CASE_SENSITIVITY(
212+
"LIKE is case-insensitive on the analytics-engine route (DataFusion), whereas the v2/Calcite"
213+
+ " path treats LIKE as case-sensitive."),
214+
215+
/**
216+
* {@code appendpipe [subpipe]} drops the main pipeline's rows on the analytics-engine route: the
217+
* subpipe's filter is applied to the main result instead of its output being appended to it, so
218+
* the original rows are lost (e.g. {@code stats ... | appendpipe [where gender='F']} returns only
219+
* the filtered F rows, not the originals plus the filtered copy).
220+
*/
221+
APPENDPIPE_MAIN_RESULT_DROPPED(
222+
"appendpipe drops the main pipeline's rows on the analytics-engine route: the subpipe filter"
223+
+ " is applied to the main result instead of appended, so the originals are lost.");
196224

197225
private final String reason;
198226

0 commit comments

Comments
 (0)