Skip to content

Commit 1f7053d

Browse files
committed
Fix incorrect YAML test assertion and add datarows validation
- Fix total count from 3 to 2 in YAML REST test (bin+chart with category produces 2 groups, not 3) - Add datarows assertions to both YAML test cases for row-level validation - Correct table statistics row count in unit test Signed-off-by: Heng Qian <qianheng@amazon.com>
1 parent 7edbc20 commit 1f7053d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

integ-test/src/yamlRestTest/resources/rest-api-spec/test/issues/5174.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ teardown:
6262
body:
6363
query: source=issue5174 | bin value span=50 as val_bin | chart count() over val_bin by category
6464

65-
- match: { total: 3 }
65+
- match: { total: 2 }
6666
- match: { schema: [ { name: val_bin, type: string }, { name: category, type: string }, { name: "count()", type: bigint } ] }
67+
- match: { datarows: [ [ "0-50", "A", 2 ], [ "100-150", "B", 1 ] ] }
6768

6869
---
6970
"Issue 5174: bin then chart with single group and null values":
@@ -79,3 +80,4 @@ teardown:
7980

8081
- match: { total: 2 }
8182
- match: { schema: [ { name: val_bin, type: string }, { name: "count()", type: bigint } ] }
83+
- match: { datarows: [ [ "0-50", 2 ], [ "100-150", 1 ] ] }

ppl/src/test/java/org/opensearch/sql/ppl/calcite/CalcitePPLChartNullTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public RelDataType getRowType(RelDataTypeFactory typeFactory) {
145145

146146
@Override
147147
public Statistic getStatistic() {
148-
return Statistics.of(0d, ImmutableList.of(), RelCollations.createSingleton(0));
148+
return Statistics.of(4d, ImmutableList.of(), RelCollations.createSingleton(0));
149149
}
150150

151151
@Override

0 commit comments

Comments
 (0)