Skip to content

Commit 4ebc221

Browse files
committed
Fix checked BIGINT SUM CI expectations
Signed-off-by: Kai Huang <ahkcs@amazon.com>
1 parent beb4ae6 commit 4ebc221

4 files changed

Lines changed: 11 additions & 16 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ public void testSumAvgLongOverflow() throws IOException {
196196
// Metric ordering remains in Calcite because OpenSearch exposes metric sort values as doubles,
197197
// which cannot distinguish these sums. Lexical tie-breaking would otherwise put "a" first.
198198
JSONObject exactSort =
199-
executeQuery(String.format("source=%s | stats sum(v) as s by g | sort - s", exactSortIndex));
199+
executeQuery(
200+
String.format("source=%s | stats sum(v) as s by g | sort - s", exactSortIndex));
200201
verifySchema(exactSort, schema("s", "bigint"), schema("g", "string"));
201-
verifyDataRows(
202-
exactSort, rows(4611686018427387905L, "z"), rows(4611686018427387904L, "a"));
202+
verifyDataRows(exactSort, rows(4611686018427387905L, "z"), rows(4611686018427387904L, "a"));
203203
}
204204

205205
@Test

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,7 @@ public void testSumWithNull() throws IOException {
512512
"source=%s | where age = 36 | stats sum(balance)",
513513
TEST_INDEX_BANK_WITH_NULL_VALUES));
514514
verifySchema(response, schema("sum(balance)", null, "bigint"));
515-
// TODO: Fix -- temporary workaround for the pushdown issue:
516-
// The current pushdown implementation will return 0 for sum when getting null values as input.
517-
// Returning null should be the expected behavior.
518-
// The analytics-engine backend (DataFusion) follows the SQL spec like Calcite-no-pushdown —
519-
// SUM of all-null is null, not 0.
520-
Integer expectedValue = (isPushdownDisabled() || isAnalyticsParquetIndicesEnabled()) ? null : 0;
521-
verifyDataRows(response, rows(expectedValue));
515+
verifyDataRows(response, rows((Object) null));
522516
}
523517

524518
@Test

0 commit comments

Comments
 (0)