Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
github.com/oklog/ulid/v2 v2.1.1
github.com/parquet-go/parquet-go v0.25.1
github.com/prometheus-community/parquet-common v0.0.0-20250610002942-dfd72bae1309
github.com/prometheus-community/parquet-common v0.0.0-20250708150752-0811a700a852
github.com/prometheus/procfs v0.16.1
github.com/sercand/kuberesolver/v5 v5.1.1
github.com/tjhop/slog-gokit v0.1.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -814,8 +814,8 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
github.com/prometheus-community/parquet-common v0.0.0-20250610002942-dfd72bae1309 h1:xGnXldBSTFPopLYi7ce+kJb+A1h1mPTeF4SLlRTEek0=
github.com/prometheus-community/parquet-common v0.0.0-20250610002942-dfd72bae1309/go.mod h1:MwYpD+FKot7LWBMFaPS6FeM8oqo77u5erRlNkSSFPA0=
github.com/prometheus-community/parquet-common v0.0.0-20250708150752-0811a700a852 h1:GNUP6g2eSqZbzGTdFK9D1RLQLjZxCkuuA/MkgfB/enQ=
github.com/prometheus-community/parquet-common v0.0.0-20250708150752-0811a700a852/go.mod h1:zJNGzMKctJoOESjRVaNTlPis3C9VcY3cRzNxj6ll3Is=
github.com/prometheus-community/prom-label-proxy v0.11.1 h1:jX+m+BQCNM0z3/P6V6jVxbiDKgugvk91SaICD6bVhT4=
github.com/prometheus-community/prom-label-proxy v0.11.1/go.mod h1:uTeQW+wZ/VPV1LL3IPfvUE++wR2nPLex+Y4RE38Cpis=
github.com/prometheus/alertmanager v0.28.1 h1:BK5pCoAtaKg01BYRUJhEDV1tqJMEtYBGzPw8QdvnnvA=
Expand Down
17 changes: 10 additions & 7 deletions pkg/querier/parquet_queryable.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/opentracing/opentracing-go"
"github.com/parquet-go/parquet-go"
"github.com/pkg/errors"
"github.com/prometheus-community/parquet-common/queryable"
"github.com/prometheus-community/parquet-common/schema"
"github.com/prometheus-community/parquet-common/search"
parquet_storage "github.com/prometheus-community/parquet-common/storage"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
Expand Down Expand Up @@ -125,14 +125,14 @@ func NewParquetQueryable(
return nil, err
}

cache, err := newCache[*parquet_storage.ParquetShard]("parquet-shards", config.ParquetQueryableShardCacheSize, newCacheMetrics(reg))
cache, err := newCache[parquet_storage.ParquetShard]("parquet-shards", config.ParquetQueryableShardCacheSize, newCacheMetrics(reg))
if err != nil {
return nil, err
}

cDecoder := schema.NewPrometheusParquetChunksDecoder(chunkenc.NewPool())

parquetQueryable, err := search.NewParquetQueryable(cDecoder, func(ctx context.Context, mint, maxt int64) ([]*parquet_storage.ParquetShard, error) {
parquetQueryable, err := queryable.NewParquetQueryable(cDecoder, func(ctx context.Context, mint, maxt int64) ([]parquet_storage.ParquetShard, error) {
userID, err := tenant.TenantID(ctx)
if err != nil {
return nil, err
Expand All @@ -144,7 +144,7 @@ func NewParquetQueryable(
}
userBkt := bucket.NewUserBucketClient(userID, bucketClient, limits)

shards := make([]*parquet_storage.ParquetShard, len(blocks))
shards := make([]parquet_storage.ParquetShard, len(blocks))
errGroup := &errgroup.Group{}

span, ctx := opentracing.StartSpanFromContext(ctx, "parquetQuerierWithFallback.OpenShards")
Expand All @@ -155,18 +155,21 @@ func NewParquetQueryable(
cacheKey := fmt.Sprintf("%v-%v", userID, block.ID)
shard := cache.Get(cacheKey)
if shard == nil {
bucketOpener := parquet_storage.NewParquetBucketOpener(userBkt)
// we always only have 1 shard - shard 0
// Use context.Background() here as the file can be cached and live after the request ends.
shard, err = parquet_storage.OpenParquetShard(context.WithoutCancel(ctx),
userBkt,
shard, err := parquet_storage.NewParquetShardOpener(
context.WithoutCancel(ctx),
block.ID.String(),
bucketOpener,
bucketOpener,
0,
parquet_storage.WithFileOptions(
parquet.SkipMagicBytes(true),
parquet.ReadBufferSize(100*1024),
parquet.SkipBloomFilters(true),
parquet.OptimisticRead(true),
),
parquet_storage.WithOptimisticReader(true),
)
if err != nil {
return errors.Wrapf(err, "failed to open parquet shard. block: %v", block.ID.String())
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

148 changes: 106 additions & 42 deletions vendor/github.com/prometheus-community/parquet-common/convert/writer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading