forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mapexpression-function-arg
- Loading branch information
Showing
47 changed files
with
1,280 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 118016 | ||
summary: Propagate status codes from shard failures appropriately | ||
area: Search | ||
type: enhancement | ||
issues: | ||
- 118482 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 118870 | ||
summary: Rewrite TO_UPPER/TO_LOWER comparisons | ||
area: ES|QL | ||
type: enhancement | ||
issues: | ||
- 118304 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 118999 | ||
summary: Fix loss of context in the inference API for streaming APIs | ||
area: Machine Learning | ||
type: bug | ||
issues: | ||
- 119000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 119131 | ||
summary: Expose BwC enrich cache setting in plugin | ||
area: Ingest Node | ||
type: bug | ||
issues: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 14 additions & 2 deletions
16
...rc/main/generated-src/org/elasticsearch/compute/aggregation/ValuesBytesRefAggregator.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...est/java/org/elasticsearch/compute/aggregation/ValuesBytesRefAggregatorFunctionTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.compute.aggregation; | ||
|
||
import org.apache.lucene.util.BytesRef; | ||
import org.elasticsearch.compute.data.Block; | ||
import org.elasticsearch.compute.data.BlockFactory; | ||
import org.elasticsearch.compute.data.BlockUtils; | ||
import org.elasticsearch.compute.operator.SequenceBytesRefBlockSourceOperator; | ||
import org.elasticsearch.compute.operator.SourceOperator; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.TreeSet; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.IntStream; | ||
|
||
import static org.hamcrest.Matchers.containsInAnyOrder; | ||
|
||
public class ValuesBytesRefAggregatorFunctionTests extends AggregatorFunctionTestCase { | ||
@Override | ||
protected SourceOperator simpleInput(BlockFactory blockFactory, int size) { | ||
return new SequenceBytesRefBlockSourceOperator( | ||
blockFactory, | ||
IntStream.range(0, size).mapToObj(l -> new BytesRef(randomAlphaOfLengthBetween(0, 100))) | ||
); | ||
} | ||
|
||
@Override | ||
protected AggregatorFunctionSupplier aggregatorFunction(List<Integer> inputChannels) { | ||
return new ValuesBytesRefAggregatorFunctionSupplier(inputChannels); | ||
} | ||
|
||
@Override | ||
protected String expectedDescriptionOfAggregator() { | ||
return "values of bytes"; | ||
} | ||
|
||
@Override | ||
public void assertSimpleOutput(List<Block> input, Block result) { | ||
TreeSet<?> set = new TreeSet<>((List<?>) BlockUtils.toJavaObject(result, 0)); | ||
Object[] values = input.stream() | ||
.flatMap(AggregatorFunctionTestCase::allBytesRefs) | ||
.collect(Collectors.toSet()) | ||
.toArray(Object[]::new); | ||
if (false == set.containsAll(Arrays.asList(values))) { | ||
assertThat(set, containsInAnyOrder(values)); | ||
} | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
.../org/elasticsearch/compute/aggregation/ValuesBytesRefGroupingAggregatorFunctionTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.compute.aggregation; | ||
|
||
import org.apache.lucene.util.BytesRef; | ||
import org.elasticsearch.compute.data.Block; | ||
import org.elasticsearch.compute.data.BlockFactory; | ||
import org.elasticsearch.compute.data.BlockUtils; | ||
import org.elasticsearch.compute.data.Page; | ||
import org.elasticsearch.compute.operator.LongBytesRefTupleBlockSourceOperator; | ||
import org.elasticsearch.compute.operator.SourceOperator; | ||
import org.elasticsearch.core.Tuple; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.TreeSet; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.IntStream; | ||
|
||
import static org.hamcrest.Matchers.containsInAnyOrder; | ||
import static org.hamcrest.Matchers.equalTo; | ||
import static org.hamcrest.Matchers.nullValue; | ||
|
||
public class ValuesBytesRefGroupingAggregatorFunctionTests extends GroupingAggregatorFunctionTestCase { | ||
@Override | ||
protected AggregatorFunctionSupplier aggregatorFunction(List<Integer> inputChannels) { | ||
return new ValuesBytesRefAggregatorFunctionSupplier(inputChannels); | ||
} | ||
|
||
@Override | ||
protected String expectedDescriptionOfAggregator() { | ||
return "values of bytes"; | ||
} | ||
|
||
@Override | ||
protected SourceOperator simpleInput(BlockFactory blockFactory, int size) { | ||
return new LongBytesRefTupleBlockSourceOperator( | ||
blockFactory, | ||
IntStream.range(0, size).mapToObj(l -> Tuple.tuple(randomLongBetween(0, 4), new BytesRef(randomAlphaOfLengthBetween(0, 100)))) | ||
); | ||
} | ||
|
||
@Override | ||
public void assertSimpleGroup(List<Page> input, Block result, int position, Long group) { | ||
Object[] values = input.stream().flatMap(p -> allBytesRefs(p, group)).collect(Collectors.toSet()).toArray(Object[]::new); | ||
Object resultValue = BlockUtils.toJavaObject(result, position); | ||
switch (values.length) { | ||
case 0 -> assertThat(resultValue, nullValue()); | ||
case 1 -> assertThat(resultValue, equalTo(values[0])); | ||
default -> { | ||
TreeSet<?> set = new TreeSet<>((List<?>) resultValue); | ||
if (false == set.containsAll(Arrays.asList(values))) { | ||
assertThat(set, containsInAnyOrder(values)); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.