Skip to content

Commit

Permalink
chore: replace remaining references to ExtractTestableLineFilters (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
rfratto authored Sep 13, 2024
1 parent 4de51f9 commit ebe0bb8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/bloomgateway/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func convertToShortRef(ref *logproto.ChunkRef) *logproto.ShortRef {

func (bq *BloomQuerier) FilterChunkRefs(ctx context.Context, tenant string, from, through model.Time, chunkRefs []*logproto.ChunkRef, queryPlan plan.QueryPlan) ([]*logproto.ChunkRef, error) {
// Shortcut that does not require any filtering
if !bq.limits.BloomGatewayEnabled(tenant) || len(chunkRefs) == 0 || len(v1.ExtractTestableLineFilters(queryPlan.AST)) == 0 {
if !bq.limits.BloomGatewayEnabled(tenant) || len(chunkRefs) == 0 || len(v1.ExtractTestableLabelMatchers(queryPlan.AST)) == 0 {
return chunkRefs, nil
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/bloomgateway/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestBloomQuerier(t *testing.T) {
through := model.Now()
from := through.Add(-12 * time.Hour)
chunkRefs := []*logproto.ChunkRef{}
expr, err := syntax.ParseExpr(`{foo="bar"} |= "uuid"`)
expr, err := syntax.ParseExpr(`{foo="bar"} | trace_id="exists"`)
require.NoError(t, err)
res, err := bq.FilterChunkRefs(ctx, tenant, from, through, chunkRefs, plan.QueryPlan{AST: expr})
require.NoError(t, err)
Expand All @@ -113,7 +113,7 @@ func TestBloomQuerier(t *testing.T) {
{Fingerprint: 1000, UserID: tenant, From: from, Through: through, Checksum: 2},
{Fingerprint: 2000, UserID: tenant, From: from, Through: through, Checksum: 3},
}
expr, err := syntax.ParseExpr(`{foo="bar"} |= "uuid"`)
expr, err := syntax.ParseExpr(`{foo="bar"} | trace_id="exists"`)
require.NoError(t, err)
res, err := bq.FilterChunkRefs(ctx, tenant, from, through, chunkRefs, plan.QueryPlan{AST: expr})
require.Error(t, err)
Expand All @@ -132,7 +132,7 @@ func TestBloomQuerier(t *testing.T) {
{Fingerprint: 2000, UserID: tenant, From: mktime("2024-04-16 23:30"), Through: mktime("2024-04-17 00:30"), Checksum: 2}, // day 1
{Fingerprint: 3000, UserID: tenant, From: mktime("2024-04-17 00:30"), Through: mktime("2024-04-17 01:30"), Checksum: 3}, // day 2
}
expr, err := syntax.ParseExpr(`{foo="bar"} |= "uuid"`)
expr, err := syntax.ParseExpr(`{foo="bar"} | trace_id="exists"`)
require.NoError(t, err)
res, err := bq.FilterChunkRefs(ctx, tenant, from, through, chunkRefs, plan.QueryPlan{AST: expr})
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/indexgateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func (g *Gateway) GetChunkRef(ctx context.Context, req *logproto.GetChunkRefRequ

// Extract LineFiltersExpr from the plan. If there is none, we can short-circuit and return before making a req
// to the bloom-gateway (through the g.bloomQuerier)
if len(v1.ExtractTestableLineFilters(req.Plan.AST)) == 0 {
if len(v1.ExtractTestableLabelMatchers(req.Plan.AST)) == 0 {
return result, nil
}

Expand Down

0 comments on commit ebe0bb8

Please sign in to comment.