-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Binary search for sorted arrays #26253
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@Frodatima will you end up building the list of ids by hand in the statement? |
I would rather not because the list will change over time. I want to provide it via a confmap provider |
@Frodatima Could you provide an example of how you'd like to provide the list? The only way I see to do it currently using a confmap provider would be through e.g. the file provider by providing a Collector config fragment, which from OTTL's perspective is equivalent to providing it by hand. |
Yes, exactly. I want to deploy them through the file provider. So I want to provide them by hand |
I do believe a function that checks if a given item is in a list is a good feature. I can think of 2 ways of doing this:
|
I found a solution for my specific problem. |
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
I have a list of 10.000 to 100.000 unique sorted IDs. And I want to filter logs depending on whether an attribute is in that list or not. Without optimization, I would need to compare each log to each ID. A binary search algorithm would reduce the number of needed comparisons.
Describe the solution you'd like
A new function, or a new flag for IsMatch, that allows optimization.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: