Merged
Conversation
This adds a method to build a new `Block` by looking up the values in an existing `Block`. Like `BlockHash#lookup` this returns a `ReleasableIterator`. This should allow us to load values using the results of `BlockHash#lookup`.
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
dnhatn
approved these changes
Apr 27, 2024
Member
dnhatn
left a comment
There was a problem hiding this comment.
One comment, but looks great. Thanks Nik!
| * same number of {@link #getPositionCount() positions} as the {@code positions} | ||
| * parameter. | ||
| * <p> | ||
| * For example, this this block contained {@code [a, b, [b, c]]} |
| $Type$Block filter(int... positions); | ||
|
|
||
| @Override | ||
| ReleasableIterator<? extends $Type$Block> lookup(IntBlock positions, ByteSizeValue targetBlockSize); |
Member
There was a problem hiding this comment.
Should we make it as a default method, overrides subclasses where we can have optimizations?
Member
Author
There was a problem hiding this comment.
I thought about it and decided against it because:
- I thought it'd be weird to stick it here - on
X-Blockinstead of onBlock. If it were onBlockthat'd be normal and good and easy. But putting it here feels a bit sneaky. - I think I'd remove it before too long anyway. I feel like I'm going to need a
Vector#lookupbefore too long and that'd need the override here. I guess the others... I dunno. I'm going to skip it for now.
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jun 7, 2024
This adds support for `LOOKUP`, a command that implements a sort of
inline `ENRICH`, using data that is passed in the request:
```
$ curl -uelastic:password -HContent-Type:application/json -XPOST \
'localhost:9200/_query?error_trace&pretty&format=txt' \
-d'{
"query": "ROW a=1::LONG | LOOKUP t ON a",
"tables": {
"t": {
"a:long": [ 1, 4, 2],
"v1:integer": [ 10, 11, 12],
"v2:keyword": ["cat", "dog", "wow"]
}
},
"version": "2024.04.01"
}'
v1 | v2 | a
---------------+---------------+---------------
10 |cat |1
```
This required these PRs: * #107624 * #107634 * #107701 * #107762 *
#107923 * #107894 * #107982 * #108012 * #108020 * #108169 * #108191 *
#108334 * #108482 * #108696 * #109040 * #109045
Closes #107306
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a method to build a new
Blockby looking up the values in an existingBlock. LikeBlockHash#lookupthis returns aReleasableIterator. This should allow us to load values using the results ofBlockHash#lookup.