Commit 1af93e1
authored
sum of empty histogram is now null (#138378)
Part of #137988
Implement #138349 for the t-digest field type.
This changes the behavior of the sum sub-field of t-digest when the digest is empty. Prior to this PR we treated it as 0, and this changes it to be null. This avoids a division by zero error in ESQL when trying to calculate the average of an empty histogram. We are adopting the same behavior for the exponential histogram field (see PR linked above), and this is important to keep the semantics of the two fields as close as possible.1 parent 6f70507 commit 1af93e1
File tree
3 files changed
+20
-10
lines changed- x-pack/plugin
- analytics/src/main/java/org/elasticsearch/xpack/analytics/mapper
- src/yamlRestTest/resources/rest-api-spec/test/analytics
3 files changed
+20
-10
lines changedLines changed: 19 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
409 | 412 | | |
410 | 413 | | |
411 | 414 | | |
| |||
417 | 420 | | |
418 | 421 | | |
419 | 422 | | |
420 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
421 | 426 | | |
422 | 427 | | |
423 | 428 | | |
| |||
564 | 569 | | |
565 | 570 | | |
566 | 571 | | |
567 | | - | |
568 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
569 | 578 | | |
570 | 579 | | |
571 | 580 | | |
| |||
595 | 604 | | |
596 | 605 | | |
597 | 606 | | |
598 | | - | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
599 | 610 | | |
600 | 611 | | |
601 | 612 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
280 | 279 | | |
281 | 280 | | |
282 | 281 | | |
| |||
0 commit comments