Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,6 @@ tests:
- class: org.elasticsearch.search.query.QueryPhaseTimeoutTests
method: testScorerTimeoutTerms
issue: https://github.com/elastic/elasticsearch/issues/124141
- class: org.elasticsearch.compute.data.BlockMultiValuedTests
method: testToMask {elementType=BOOLEAN nullAllowed=true}
issue: https://github.com/elastic/elasticsearch/issues/124165
- class: org.elasticsearch.smoketest.MlWithSecurityIT
method: test {yaml=ml/start_data_frame_analytics/Test start classification analysis when the dependent variable is missing}
issue: https://github.com/elastic/elasticsearch/issues/124168
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.function.IntUnaryOperator;
import java.util.stream.IntStream;

Expand Down Expand Up @@ -133,10 +134,12 @@ public void testToMask() {
if (elementType != ElementType.BOOLEAN) {
return;
}
int positionCount = randomIntBetween(1, 16 * 1024);
int positionCount = randomIntBetween(0, 16 * 1024);
Copy link
Contributor Author

@ivancea ivancea Mar 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change doesn't do much, but as it now correctly works with 0 elements, we assert that noElements == !hadMultivaluedFields

var b = RandomBlock.randomBlock(blockFactory(), elementType, positionCount, nullAllowed, 2, 10, 0, 0);
try (ToMask mask = ((BooleanBlock) b.block()).toMask()) {
assertThat(mask.hadMultivaluedFields(), equalTo(true));
var anyNonNullValue = b.values().stream().anyMatch(Objects::nonNull);
assertThat(mask.hadMultivaluedFields(), equalTo(anyNonNullValue));

for (int p = 0; p < b.values().size(); p++) {
List<Object> v = b.values().get(p);
if (v == null) {
Expand Down