File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
qa/testFixtures/src/main/resources
src/main/java/org/elasticsearch/xpack/esql/stats Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1217,3 +1217,12 @@ FROM airports
1217
1217
c:l
1218
1218
891
1219
1219
;
1220
+
1221
+ countMV#[skip:-8.13.0,reason:fixed in 8.13.1]
1222
+ FROM employees
1223
+ | STATS vals = COUNT(salary_change.int)
1224
+ ;
1225
+
1226
+ vals:l
1227
+ 183
1228
+ ;
Original file line number Diff line number Diff line change @@ -195,11 +195,13 @@ public boolean isSingleValue(String field) {
195
195
if (exists (field ) == false ) {
196
196
stat .singleValue = true ;
197
197
} else {
198
- var sv = new boolean [] { true };
198
+ // fields are MV per default
199
+ var sv = new boolean [] { false };
199
200
for (SearchContext context : contexts ) {
200
201
var sec = context .getSearchExecutionContext ();
201
- MappedFieldType mappedType = sec .isFieldMapped (field ) ? null : sec .getFieldType (field );
202
+ MappedFieldType mappedType = sec .isFieldMapped (field ) ? sec .getFieldType (field ) : null ;
202
203
if (mappedType != null ) {
204
+ sv [0 ] = true ;
203
205
doWithContexts (r -> {
204
206
sv [0 ] &= detectSingleValue (r , mappedType , field );
205
207
return sv [0 ];
You can’t perform that action at this time.
0 commit comments