Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,52 @@ task integTestRemote(type: RestIntegTestTask) {
// === Excludes: CalcitePPLBasicIT route divergence ===
// REGEXP filter throws a backend NullPointerException on the AE route.
excludeTestsMatching '*CalcitePPLBasicIT.testRegexpFilter'

// === Excludes: percentile is approximate on AE (DataFusion) but exact on v2/Calcite ===
excludeTestsMatching '*StatsCommandIT.testStatsPercentileWithNull'
excludeTestsMatching '*StatsCommandIT.testStatsPercentileByNullValue'
excludeTestsMatching '*StatsCommandIT.testStatsPercentileByNullValueNonNullBucket'
excludeTestsMatching '*StatsCommandIT.testStatsPercentileBySpan'
excludeTestsMatching '*CalcitePPLAggregationIT.testPercentile'
excludeTestsMatching '*CalcitePPLAggregationIT.testPercentileShortcutsFloatingPoint'

// === Excludes: span() time-field bucketing differs on the AE route ===
excludeTestsMatching '*StatsCommandIT.testStatsBySpanTimeWithNullBucket'
excludeTestsMatching '*CalciteChartCommandIT.testChartMaxValueByTimestampSpanDayAndWeek'

// === Excludes: float/half_float arithmetic keeps 32-bit precision on AE ===
excludeTestsMatching '*CalcitePPLBuiltinFunctionIT.testDivide'
excludeTestsMatching '*CalcitePPLBuiltinFunctionIT.testModFloatAndNegative'
excludeTestsMatching '*CalcitePPLBuiltinFunctionIT.testModShouldReturnWiderTypes'

// === Excludes: date_format/strftime render some tokens differently on AE ===
excludeTestsMatching '*DateTimeFunctionIT.testDateFormat'
excludeTestsMatching '*CalciteDateTimeFunctionIT.testStrftimeWithDateFields'

// === Excludes: unix_timestamp drops sub-second precision on AE ===
excludeTestsMatching '*DateTimeFunctionIT.testUnixTimestampWithTimestampString'

// === Excludes: json_set/json_delete with a $-prefixed path is a no-op on AE ===
excludeTestsMatching '*CalcitePPLJsonBuiltinFunctionIT.testJsonSetWithDollarPrefixedPath'
excludeTestsMatching '*CalcitePPLJsonBuiltinFunctionIT.testJsonDeleteWithDollarPrefixedPath'

// === Excludes: dedup surviving-row selection is non-deterministic on AE ===
excludeTestsMatching '*CalcitePPLDedupIT.testDedupComplex'
excludeTestsMatching '*CalcitePPLDedupIT.testDedupExpr'
excludeTestsMatching '*CalcitePPLDedupIT.testConsecutiveImplicitFallbackV2'

// === Excludes: same-index union conflates on AE (delegated predicate leak) ===
excludeTestsMatching '*CalciteUnionCommandIT.testUnionThreeSubsearches'
excludeTestsMatching '*CalciteUnionCommandIT.testUnionMidPipeline_SingleExplicitDataset'

// === Excludes: rename * returns columns in a different order on AE ===
excludeTestsMatching '*CalcitePPLRenameIT.testRenameFullWildcardExcludesMetadataFields'

// === Excludes: otel_logs multi-value field can't load into the parquet store ===
excludeTestsMatching '*CalciteChartCommandIT.testChartLimit0WithUseOther'
excludeTestsMatching '*CalciteChartCommandIT.testChartLimitTopWithUseOther'
excludeTestsMatching '*CalciteChartCommandIT.testChartLimitBottomWithUseOther'
excludeTestsMatching '*CalciteChartCommandIT.testChartLimitTopWithMinAgg'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,29 +92,24 @@ public void testTimestampRootColumnSpaceFormat() throws IOException {
verifyDataRows(result, rows("2024-03-15 10:30:00"));
}

/**
* DATE-mapped col: AE widens to TIMESTAMP at scan time; value must use space separator, not ISO
* {@code T}.
*/
/** DATE-mapped col: AE preserves the DATE type (date UDT) and renders {@code yyyy-MM-dd}. */
@Test
public void testDateRootColumnYmdFormat() throws IOException {
String query = "source=" + INDEX + " | where d = '2024-03-15' | fields d";
assertRoutedToAnalyticsEngine(query);
JSONObject result = executeQuery(query);
verifySchema(result, schema("d", "timestamp"));
verifyDataRows(result, rows("2024-03-15 00:00:00"));
verifySchema(result, schema("d", "date"));
verifyDataRows(result, rows("2024-03-15"));
}

/** TIME-mapped col: AE widens to TIMESTAMP; value must use space separator, not ISO {@code T}. */
/** TIME-mapped col: AE preserves the TIME type (time UDT) and renders {@code HH:mm:ss}. */
@Test
public void testTimeRootColumnHmsFormat() throws IOException {
String query = "source=" + INDEX + " | sort t | head 1 | fields t";
assertRoutedToAnalyticsEngine(query);
JSONObject result = executeQuery(query);
verifySchema(result, schema("t", "timestamp"));
Assert.assertFalse(
"Time-mapped column must not surface as ISO T-separator literal",
result.getJSONArray("datarows").getJSONArray(0).getString(0).contains("T"));
verifySchema(result, schema("t", "time"));
verifyDataRows(result, rows("10:30:00"));
}

/** Eval-derived TIMESTAMP follows the same wire-format contract as a root column. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_BANK_WITH_NULL_VALUES;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_OTEL_LOGS;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_TIME_DATA;
import static org.opensearch.sql.util.Capability.BIN_TIME_FIELD_BUCKETING;
import static org.opensearch.sql.util.Capability.MULTI_VALUE_FIELD_LOAD;
import static org.opensearch.sql.util.MatcherUtils.assertJsonEquals;
import static org.opensearch.sql.util.MatcherUtils.rows;
import static org.opensearch.sql.util.MatcherUtils.schema;
Expand All @@ -20,6 +22,7 @@
import org.json.JSONObject;
import org.junit.jupiter.api.Test;
import org.opensearch.sql.ppl.PPLIntegTestCase;
import org.opensearch.sql.util.RequiresCapability;

public class CalciteChartCommandIT extends PPLIntegTestCase {
@Override
Expand All @@ -28,7 +31,13 @@ public void init() throws Exception {
enableCalcite();
loadIndex(Index.BANK);
loadIndex(Index.BANK_WITH_NULL_VALUES);
loadIndex(Index.OTELLOGS);
// otel_logs has a multi-value array for a scalar-mapped field, which the parquet store rejects
// at bulk load (MULTI_VALUE_FIELD_LOAD); skip the load on the AE route so it doesn't abort
// init() for the otel-independent tests. The otel tests themselves are
// @RequiresCapability-gated.
if (!isAnalyticsParquetIndicesEnabled()) {
loadIndex(Index.OTELLOGS);
}
loadIndex(Index.TIME_TEST_DATA);
loadIndex(Index.EVENTS_NULL);
}
Expand Down Expand Up @@ -142,6 +151,11 @@ public void testChartMaxValueOverCategoryByTimestampSpanWeek() throws IOExceptio
}

@Test
@RequiresCapability(
value = BIN_TIME_FIELD_BUCKETING,
note =
"span=2weeks anchors the bucket to a different week origin on the AE route"
+ " (BIN_TIME_FIELD_BUCKETING).")
public void testChartMaxValueByTimestampSpanDayAndWeek() throws IOException {
JSONObject result =
executeQuery(
Expand All @@ -165,6 +179,11 @@ public void testChartMaxValueByTimestampSpanDayAndWeek() throws IOException {
}

@Test
@RequiresCapability(
value = MULTI_VALUE_FIELD_LOAD,
note =
"reads otel_logs whose multi-value field can't load on the AE store"
+ " (MULTI_VALUE_FIELD_LOAD).")
public void testChartLimit0WithUseOther() throws IOException {
JSONObject result =
executeQuery(
Expand Down Expand Up @@ -208,6 +227,11 @@ public void testChartLimit0WithUseOther() throws IOException {
}

@Test
@RequiresCapability(
value = MULTI_VALUE_FIELD_LOAD,
note =
"reads otel_logs whose multi-value field can't load on the AE store"
+ " (MULTI_VALUE_FIELD_LOAD).")
public void testChartLimitTopWithUseOther() throws IOException {
JSONObject result =
executeQuery(
Expand All @@ -230,6 +254,11 @@ public void testChartLimitTopWithUseOther() throws IOException {
}

@Test
@RequiresCapability(
value = MULTI_VALUE_FIELD_LOAD,
note =
"reads otel_logs whose multi-value field can't load on the AE store"
+ " (MULTI_VALUE_FIELD_LOAD).")
public void testChartLimitBottomWithUseOther() throws IOException {
JSONObject result =
executeQuery(
Expand All @@ -246,6 +275,11 @@ public void testChartLimitBottomWithUseOther() throws IOException {
}

@Test
@RequiresCapability(
value = MULTI_VALUE_FIELD_LOAD,
note =
"reads otel_logs whose multi-value field can't load on the AE store"
+ " (MULTI_VALUE_FIELD_LOAD).")
public void testChartLimitTopWithMinAgg() throws IOException {
JSONObject result =
executeQuery(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DATE;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DATE_FORMATS;
import static org.opensearch.sql.util.Capability.DATETIME_FORMAT_RENDERING;
import static org.opensearch.sql.util.MatcherUtils.rows;
import static org.opensearch.sql.util.MatcherUtils.verifyDataRows;

Expand All @@ -17,6 +18,7 @@
import org.junit.Ignore;
import org.junit.Test;
import org.opensearch.sql.ppl.DateTimeFunctionIT;
import org.opensearch.sql.util.RequiresCapability;

public class CalciteDateTimeFunctionIT extends DateTimeFunctionIT {
@Override
Expand Down Expand Up @@ -73,6 +75,9 @@ public void testStrftimeWithVariousInputTypes() throws IOException {
}

@Test
@RequiresCapability(
value = DATETIME_FORMAT_RENDERING,
note = "strftime renders sub-second precision differently on the AE route.")
public void testStrftimeWithDateFields() throws IOException {
// Test strftime with different date field types from indices
loadIndex(Index.DATE_FORMATS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DATE_FORMATS;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_LOGS;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_TELEMETRY;
import static org.opensearch.sql.util.Capability.PERCENTILE_APPROXIMATE;
import static org.opensearch.sql.util.MatcherUtils.assertJsonEquals;
import static org.opensearch.sql.util.MatcherUtils.rows;
import static org.opensearch.sql.util.MatcherUtils.schema;
Expand All @@ -28,6 +29,7 @@
import org.opensearch.sql.common.utils.StringUtils;
import org.opensearch.sql.exception.SemanticCheckException;
import org.opensearch.sql.ppl.PPLIntegTestCase;
import org.opensearch.sql.util.RequiresCapability;

public class CalcitePPLAggregationIT extends PPLIntegTestCase {

Expand Down Expand Up @@ -967,6 +969,9 @@ public void testTake() throws IOException {
}

@Test
@RequiresCapability(
value = PERCENTILE_APPROXIMATE,
note = "percentile is approximate on the AE route but exact on v2/Calcite.")
public void testPercentile() throws IOException {
JSONObject actual =
executeQuery(
Expand Down Expand Up @@ -1184,6 +1189,9 @@ public void testPercentileShortcutsWithDecimals() throws IOException {
}

@Test
@RequiresCapability(
value = PERCENTILE_APPROXIMATE,
note = "percentile is approximate on the AE route but exact on v2/Calcite.")
public void testPercentileShortcutsFloatingPoint() throws IOException {
JSONObject actual =
executeQuery(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DOG;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_NULL_MISSING;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_STATE_COUNTRY;
import static org.opensearch.sql.util.Capability.FLOAT_ARITHMETIC_PRECISION;
import static org.opensearch.sql.util.MatcherUtils.closeTo;
import static org.opensearch.sql.util.MatcherUtils.rows;
import static org.opensearch.sql.util.MatcherUtils.schema;
Expand All @@ -21,6 +22,7 @@
import org.json.JSONObject;
import org.junit.jupiter.api.Test;
import org.opensearch.sql.ppl.PPLIntegTestCase;
import org.opensearch.sql.util.RequiresCapability;

public class CalcitePPLBuiltinFunctionIT extends PPLIntegTestCase {
@Override
Expand Down Expand Up @@ -255,6 +257,9 @@ public void testModWithSortAndFields() throws IOException {
}

@Test
@RequiresCapability(
value = FLOAT_ARITHMETIC_PRECISION,
note = "float modulo keeps 32-bit precision on AE; v2 widens to double.")
public void testModFloatAndNegative() throws IOException {
JSONObject actual =
executeQuery(
Expand All @@ -267,6 +272,9 @@ public void testModFloatAndNegative() throws IOException {
}

@Test
@RequiresCapability(
value = FLOAT_ARITHMETIC_PRECISION,
note = "float modulo keeps 32-bit precision on AE; v2 widens to double.")
public void testModShouldReturnWiderTypes() throws IOException {
JSONObject actual =
executeQuery(
Expand Down Expand Up @@ -347,6 +355,9 @@ public void testSignAndRound() throws IOException {
}

@Test
@RequiresCapability(
value = FLOAT_ARITHMETIC_PRECISION,
note = "float/half_float division keeps 32-bit precision on AE; v2 widens to double.")
public void testDivide() throws IOException {
JSONObject actual =
executeQuery(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_ACCOUNT;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DUPLICATION_NULLABLE;
import static org.opensearch.sql.util.Capability.DEDUP_NONDETERMINISTIC;
import static org.opensearch.sql.util.MatcherUtils.*;

import java.io.IOException;
import org.json.JSONObject;
import org.junit.jupiter.api.Test;
import org.opensearch.sql.ppl.PPLIntegTestCase;
import org.opensearch.sql.util.RequiresCapability;

public class CalcitePPLDedupIT extends PPLIntegTestCase {

Expand Down Expand Up @@ -95,6 +97,9 @@ public void testDedupMultipleFieldsKeepEmpty() throws IOException {
}

@Test
@RequiresCapability(
value = DEDUP_NONDETERMINISTIC,
note = "dedup CONSECUTIVE behavior diverges on the AE route.")
public void testConsecutiveImplicitFallbackV2() throws IOException {
JSONObject actual =
executeQuery(
Expand Down Expand Up @@ -252,6 +257,10 @@ public void testReorderDedupFieldsShouldNotAffectResult() throws IOException {
}

@Test
@RequiresCapability(
value = DEDUP_NONDETERMINISTIC,
note =
"dedup surviving-duplicate selection diverges on the AE route (no stable merge order).")
public void testDedupComplex() throws IOException {
JSONObject actual =
executeQuery(String.format("source=%s | dedup 1 name", TEST_INDEX_DUPLICATION_NULLABLE));
Expand Down Expand Up @@ -364,6 +373,10 @@ public void testSortThenDedupKeepEmpty() throws IOException {
}

@Test
@RequiresCapability(
value = DEDUP_NONDETERMINISTIC,
note =
"dedup surviving-duplicate selection diverges on the AE route (no stable merge order).")
public void testDedupExpr() throws IOException {
JSONObject actual =
executeQuery(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import static org.opensearch.sql.expression.function.jsonUDF.JsonUtils.gson;
import static org.opensearch.sql.legacy.TestsConstants.*;
import static org.opensearch.sql.util.Capability.JSON_DOLLAR_PATH;
import static org.opensearch.sql.util.MatcherUtils.*;
import static org.opensearch.sql.util.MatcherUtils.rows;

Expand All @@ -15,6 +16,7 @@
import org.json.JSONObject;
import org.junit.jupiter.api.Test;
import org.opensearch.sql.ppl.PPLIntegTestCase;
import org.opensearch.sql.util.RequiresCapability;

public class CalcitePPLJsonBuiltinFunctionIT extends PPLIntegTestCase {
@Override
Expand All @@ -30,7 +32,12 @@ public void init() throws Exception {
loadIndex(Index.PEOPLE2);
loadIndex(Index.BANK);
loadIndex(Index.JSON_TEST);
loadIndex(Index.GAME_OF_THRONES);
// game_of_thrones has a multi-value array for the scalar-mapped `titles` field, which the
// parquet store rejects at bulk load; skip it on the AE route so it doesn't abort init() for
// the rest of the suite. No test in this class queries game_of_thrones.
if (!isAnalyticsParquetIndicesEnabled()) {
loadIndex(Index.GAME_OF_THRONES);
}
}

@Test
Expand Down Expand Up @@ -297,6 +304,9 @@ public void testJsonSetPartialSet() throws IOException {
}

@Test
@RequiresCapability(
value = JSON_DOLLAR_PATH,
note = "json_set with a $-prefixed path is a no-op on the AE route (JSON_DOLLAR_PATH).")
public void testJsonSetWithDollarPrefixedPath() throws IOException {
// Issue #5167: json_set with $.key path should not double-prefix
JSONObject actual =
Expand All @@ -313,6 +323,9 @@ public void testJsonSetWithDollarPrefixedPath() throws IOException {
}

@Test
@RequiresCapability(
value = JSON_DOLLAR_PATH,
note = "json_delete with a $-prefixed path is a no-op on the AE route (JSON_DOLLAR_PATH).")
public void testJsonDeleteWithDollarPrefixedPath() throws IOException {
// Issue #5167: json_delete with $.key path should remove the key
JSONObject actual =
Expand Down
Loading
Loading