Skip to content

Conversation

@jesusvazquez
Copy link
Contributor

@jesusvazquez jesusvazquez commented Jul 31, 2025

Updated filter function by sorting with slices.sort instead of custom
loop that led to out of index.

Also updated unit tests for queryable and constraint filter

Note, breaking, also renamed MatchersToConstraint into MatchersToConstraints

panic: runtime error: index out of range [2] with length 2

goroutine 46490 [running]:
github.com/prometheus-community/parquet-common/search.Filter({0x4f5a5d0, 0xc02fab8a00}, {0x7c89d5a0e900?, 0xc02f9e4de0?}, 0x0, {0xc02f95bca0, 0x2, 0xc01af08330?})
        vendor/github.com/prometheus-community/parquet-common/search/constraint.go:91 +0x473
github.com/grafana/mimir/pkg/storage/parquet.queryableShard.Query.func1()
       vendor/github.com/grafana/mimir/pkg/storage/parquet/queryable_shard.go:60 +0x13e
golang.org/x/sync/errgroup.(*Group).Go.func1()
        vendor/golang.org/x/sync/errgroup/errgroup.go:93 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 46489
        vendor/golang.org/x/sync/errgroup/errgroup.go:78 +0x93

Updated filter function by sorting with slices.sort instead of custom
loop that led to out of index.

Also updated unit tests for queryable and constraint filter

Also rename MatchersToConstraint into MatchersToConstraints

Signed-off-by: Jesus Vazquez <[email protected]>
@jesusvazquez jesusvazquez force-pushed the jvp/search-constraints-index-out-of-range branch from 3ec5ecb to 5a358cf Compare July 31, 2025 15:56
@jesusvazquez jesusvazquez changed the title WIP fix(search): constraint filtering panics with out of index fix(search): constraint filtering panics with out of index Jul 31, 2025
@jesusvazquez
Copy link
Contributor Author

Tested this live and seems to be working for me now.

@jesusvazquez jesusvazquez marked this pull request as ready for review July 31, 2025 16:15
@jesusvazquez jesusvazquez merged commit 7101e5a into main Jul 31, 2025
7 checks passed
francoposa pushed a commit that referenced this pull request Aug 7, 2025
Updated filter function by sorting with slices.sort instead of custom
loop that led to out of index.

Also updated unit tests for queryable and constraint filter

Also rename MatchersToConstraint into MatchersToConstraints

Signed-off-by: Jesus Vazquez <[email protected]>
Signed-off-by: francoposa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants