Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 27 additions & 28 deletions search/parquet_queriable.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,6 @@ func newQueryableShard(opts *queryableOpts, block *storage.ParquetShard, d *sche
}

func (b queryableShard) Query(ctx context.Context, sorted bool, mint, maxt int64, skipChunks bool, matchers []*labels.Matcher) (prom_storage.ChunkSeriesSet, error) {
cs, err := MatchersToConstraint(matchers...)
if err != nil {
return nil, err
}
err = Initialize(b.shard.LabelsFile(), cs...)
if err != nil {
return nil, err
}

errGroup, ctx := errgroup.WithContext(ctx)
errGroup.SetLimit(b.concurrency)

Expand All @@ -250,7 +241,15 @@ func (b queryableShard) Query(ctx context.Context, sorted bool, mint, maxt int64

for i, group := range b.shard.LabelsFile().RowGroups() {
errGroup.Go(func() error {
rr, err := Filter(ctx, group, append([]Constraint{}, cs...)...)
cs, err := MatchersToConstraint(matchers...)
if err != nil {
return err
}
err = Initialize(b.shard.LabelsFile(), cs...)
if err != nil {
return err
}
rr, err := Filter(ctx, group, cs...)
if err != nil {
return err
}
Expand Down Expand Up @@ -284,14 +283,6 @@ func (b queryableShard) LabelNames(ctx context.Context, limit int64, matchers []
if len(matchers) == 0 {
return b.m.MaterializeAllLabelNames(), nil
}
cs, err := MatchersToConstraint(matchers...)
if err != nil {
return nil, err
}
err = Initialize(b.shard.LabelsFile(), cs...)
if err != nil {
return nil, err
}

errGroup, ctx := errgroup.WithContext(ctx)
errGroup.SetLimit(b.concurrency)
Expand All @@ -300,7 +291,15 @@ func (b queryableShard) LabelNames(ctx context.Context, limit int64, matchers []

for i, group := range b.shard.LabelsFile().RowGroups() {
errGroup.Go(func() error {
rr, err := Filter(ctx, group, append([]Constraint{}, cs...)...)
cs, err := MatchersToConstraint(matchers...)
if err != nil {
return err
}
err = Initialize(b.shard.LabelsFile(), cs...)
if err != nil {
return err
}
rr, err := Filter(ctx, group, cs...)
if err != nil {
return err
}
Expand All @@ -324,14 +323,6 @@ func (b queryableShard) LabelValues(ctx context.Context, name string, limit int6
if len(matchers) == 0 {
return b.allLabelValues(ctx, name, limit)
}
cs, err := MatchersToConstraint(matchers...)
if err != nil {
return nil, err
}
err = Initialize(b.shard.LabelsFile(), cs...)
if err != nil {
return nil, err
}

errGroup, ctx := errgroup.WithContext(ctx)
errGroup.SetLimit(b.concurrency)
Expand All @@ -340,7 +331,15 @@ func (b queryableShard) LabelValues(ctx context.Context, name string, limit int6

for i, group := range b.shard.LabelsFile().RowGroups() {
errGroup.Go(func() error {
rr, err := Filter(ctx, group, append([]Constraint{}, cs...)...)
cs, err := MatchersToConstraint(matchers...)
if err != nil {
return err
}
err = Initialize(b.shard.LabelsFile(), cs...)
if err != nil {
return err
}
rr, err := Filter(ctx, group, cs...)
if err != nil {
return err
}
Expand Down