Skip to content

Commit 91b1377

Browse files
authored
Updating parquet common to latest (#6866)
* Updating parquet common to latest Signed-off-by: alanprot <[email protected]> * fix shard creation Signed-off-by: alanprot <[email protected]> --------- Signed-off-by: alanprot <[email protected]>
1 parent e4b0f1b commit 91b1377

File tree

14 files changed

+540
-223
lines changed

14 files changed

+540
-223
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ require (
8383
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
8484
github.com/oklog/ulid/v2 v2.1.1
8585
github.com/parquet-go/parquet-go v0.25.1
86-
github.com/prometheus-community/parquet-common v0.0.0-20250610002942-dfd72bae1309
86+
github.com/prometheus-community/parquet-common v0.0.0-20250708150752-0811a700a852
8787
github.com/prometheus/procfs v0.16.1
8888
github.com/sercand/kuberesolver/v5 v5.1.1
8989
github.com/tjhop/slog-gokit v0.1.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,8 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr
814814
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
815815
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
816816
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
817-
github.com/prometheus-community/parquet-common v0.0.0-20250610002942-dfd72bae1309 h1:xGnXldBSTFPopLYi7ce+kJb+A1h1mPTeF4SLlRTEek0=
818-
github.com/prometheus-community/parquet-common v0.0.0-20250610002942-dfd72bae1309/go.mod h1:MwYpD+FKot7LWBMFaPS6FeM8oqo77u5erRlNkSSFPA0=
817+
github.com/prometheus-community/parquet-common v0.0.0-20250708150752-0811a700a852 h1:GNUP6g2eSqZbzGTdFK9D1RLQLjZxCkuuA/MkgfB/enQ=
818+
github.com/prometheus-community/parquet-common v0.0.0-20250708150752-0811a700a852/go.mod h1:zJNGzMKctJoOESjRVaNTlPis3C9VcY3cRzNxj6ll3Is=
819819
github.com/prometheus-community/prom-label-proxy v0.11.1 h1:jX+m+BQCNM0z3/P6V6jVxbiDKgugvk91SaICD6bVhT4=
820820
github.com/prometheus-community/prom-label-proxy v0.11.1/go.mod h1:uTeQW+wZ/VPV1LL3IPfvUE++wR2nPLex+Y4RE38Cpis=
821821
github.com/prometheus/alertmanager v0.28.1 h1:BK5pCoAtaKg01BYRUJhEDV1tqJMEtYBGzPw8QdvnnvA=

pkg/querier/parquet_queryable.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"github.com/opentracing/opentracing-go"
1212
"github.com/parquet-go/parquet-go"
1313
"github.com/pkg/errors"
14+
"github.com/prometheus-community/parquet-common/queryable"
1415
"github.com/prometheus-community/parquet-common/schema"
15-
"github.com/prometheus-community/parquet-common/search"
1616
parquet_storage "github.com/prometheus-community/parquet-common/storage"
1717
"github.com/prometheus/client_golang/prometheus"
1818
"github.com/prometheus/client_golang/prometheus/promauto"
@@ -125,14 +125,14 @@ func NewParquetQueryable(
125125
return nil, err
126126
}
127127

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

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

135-
parquetQueryable, err := search.NewParquetQueryable(cDecoder, func(ctx context.Context, mint, maxt int64) ([]*parquet_storage.ParquetShard, error) {
135+
parquetQueryable, err := queryable.NewParquetQueryable(cDecoder, func(ctx context.Context, mint, maxt int64) ([]parquet_storage.ParquetShard, error) {
136136
userID, err := tenant.TenantID(ctx)
137137
if err != nil {
138138
return nil, err
@@ -143,8 +143,8 @@ func NewParquetQueryable(
143143
return nil, errors.Errorf("failed to extract blocks from context")
144144
}
145145
userBkt := bucket.NewUserBucketClient(userID, bucketClient, limits)
146-
147-
shards := make([]*parquet_storage.ParquetShard, len(blocks))
146+
bucketOpener := parquet_storage.NewParquetBucketOpener(userBkt)
147+
shards := make([]parquet_storage.ParquetShard, len(blocks))
148148
errGroup := &errgroup.Group{}
149149

150150
span, ctx := opentracing.StartSpanFromContext(ctx, "parquetQuerierWithFallback.OpenShards")
@@ -157,16 +157,18 @@ func NewParquetQueryable(
157157
if shard == nil {
158158
// we always only have 1 shard - shard 0
159159
// Use context.Background() here as the file can be cached and live after the request ends.
160-
shard, err = parquet_storage.OpenParquetShard(context.WithoutCancel(ctx),
161-
userBkt,
160+
shard, err = parquet_storage.NewParquetShardOpener(
161+
context.WithoutCancel(ctx),
162162
block.ID.String(),
163+
bucketOpener,
164+
bucketOpener,
163165
0,
164166
parquet_storage.WithFileOptions(
165167
parquet.SkipMagicBytes(true),
166168
parquet.ReadBufferSize(100*1024),
167169
parquet.SkipBloomFilters(true),
170+
parquet.OptimisticRead(true),
168171
),
169-
parquet_storage.WithOptimisticReader(true),
170172
)
171173
if err != nil {
172174
return errors.Wrapf(err, "failed to open parquet shard. block: %v", block.ID.String())

vendor/github.com/prometheus-community/parquet-common/convert/convert.go

Lines changed: 15 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/prometheus-community/parquet-common/convert/merge.go

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/prometheus-community/parquet-common/convert/writer.go

Lines changed: 106 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)