Skip to content

Commit 746b40e

Browse files
authored
Update parquet common to latest main to pull sort series fix (#6988)
* update parquet common to latest main to pull sort series fix Signed-off-by: Ben Ye <[email protected]> * fix build Signed-off-by: Ben Ye <[email protected]> * update to latest Signed-off-by: Ben Ye <[email protected]> --------- Signed-off-by: Ben Ye <[email protected]>
1 parent 42b35fa commit 746b40e

File tree

14 files changed

+1160
-399
lines changed

14 files changed

+1160
-399
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ require (
8484
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
8585
github.com/oklog/ulid/v2 v2.1.1
8686
github.com/parquet-go/parquet-go v0.25.1
87-
github.com/prometheus-community/parquet-common v0.0.0-20250807102632-2aeeceacebf0
87+
github.com/prometheus-community/parquet-common v0.0.0-20250827225610-65f0b68d35e6
8888
github.com/prometheus/procfs v0.16.1
8989
github.com/sercand/kuberesolver/v5 v5.1.1
9090
github.com/tjhop/slog-gokit v0.1.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,8 +1611,8 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr
16111611
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
16121612
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
16131613
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
1614-
github.com/prometheus-community/parquet-common v0.0.0-20250807102632-2aeeceacebf0 h1:5mm5mMmEhUdvqf4NsVvEGWry0IeXkeZEfODbZ70c1Ok=
1615-
github.com/prometheus-community/parquet-common v0.0.0-20250807102632-2aeeceacebf0/go.mod h1:MbAv/yCv9GORLj0XvXgRF913R9Jc04+BvVq4VJpPCi0=
1614+
github.com/prometheus-community/parquet-common v0.0.0-20250827225610-65f0b68d35e6 h1:jWcDrCpAU047f2NTGtm3vRPqJ8skDOkdKCC5sSfSN4Q=
1615+
github.com/prometheus-community/parquet-common v0.0.0-20250827225610-65f0b68d35e6/go.mod h1:MbAv/yCv9GORLj0XvXgRF913R9Jc04+BvVq4VJpPCi0=
16161616
github.com/prometheus-community/prom-label-proxy v0.11.1 h1:jX+m+BQCNM0z3/P6V6jVxbiDKgugvk91SaICD6bVhT4=
16171617
github.com/prometheus-community/prom-label-proxy v0.11.1/go.mod h1:uTeQW+wZ/VPV1LL3IPfvUE++wR2nPLex+Y4RE38Cpis=
16181618
github.com/prometheus/alertmanager v0.28.1 h1:BK5pCoAtaKg01BYRUJhEDV1tqJMEtYBGzPw8QdvnnvA=

pkg/querier/parquet_queryable.go

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -159,38 +159,34 @@ func NewParquetQueryable(
159159
return int64(limits.ParquetMaxFetchedDataBytes(userID))
160160
}),
161161
queryable.WithMaterializedLabelsFilterCallback(materializedLabelsFilterCallback),
162-
queryable.WithMaterializedSeriesCallback(func(ctx context.Context, cs []storage.ChunkSeries) error {
162+
queryable.WithMaterializedSeriesCallback(func(ctx context.Context, series storage.ChunkSeries) error {
163163
queryLimiter := limiter.QueryLimiterFromContextWithFallback(ctx)
164-
lbls := make([][]cortexpb.LabelAdapter, 0, len(cs))
165-
for _, series := range cs {
166-
chkCount := 0
167-
chunkSize := 0
168-
lblSize := 0
169-
lblAdapter := cortexpb.FromLabelsToLabelAdapters(series.Labels())
170-
lbls = append(lbls, lblAdapter)
171-
for _, lbl := range lblAdapter {
172-
lblSize += lbl.Size()
173-
}
174-
iter := series.Iterator(nil)
175-
for iter.Next() {
176-
chk := iter.At()
177-
chunkSize += len(chk.Chunk.Bytes())
178-
chkCount++
179-
}
180-
if chkCount > 0 {
181-
if err := queryLimiter.AddChunks(chkCount); err != nil {
182-
return validation.LimitError(err.Error())
183-
}
184-
if err := queryLimiter.AddChunkBytes(chunkSize); err != nil {
185-
return validation.LimitError(err.Error())
186-
}
164+
chkCount := 0
165+
chunkSize := 0
166+
lblSize := 0
167+
lblAdapter := cortexpb.FromLabelsToLabelAdapters(series.Labels())
168+
for _, lbl := range lblAdapter {
169+
lblSize += lbl.Size()
170+
}
171+
iter := series.Iterator(nil)
172+
for iter.Next() {
173+
chk := iter.At()
174+
chunkSize += len(chk.Chunk.Bytes())
175+
chkCount++
176+
}
177+
if chkCount > 0 {
178+
if err := queryLimiter.AddChunks(chkCount); err != nil {
179+
return validation.LimitError(err.Error())
187180
}
188-
189-
if err := queryLimiter.AddDataBytes(chunkSize + lblSize); err != nil {
181+
if err := queryLimiter.AddChunkBytes(chunkSize); err != nil {
190182
return validation.LimitError(err.Error())
191183
}
192184
}
193-
if err := queryLimiter.AddSeries(lbls...); err != nil {
185+
186+
if err := queryLimiter.AddDataBytes(chunkSize + lblSize); err != nil {
187+
return validation.LimitError(err.Error())
188+
}
189+
if err := queryLimiter.AddSeries(lblAdapter); err != nil {
194190
return validation.LimitError(err.Error())
195191
}
196192
return nil

pkg/querier/parquet_queryable_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ func TestParquetQueryable_Limits(t *testing.T) {
478478
return validation.NewOverrides(limits, nil)
479479
}(),
480480
queryLimiter: limiter.NewQueryLimiter(0, 1, 0, 0),
481-
expectedErr: fmt.Errorf("materializer failed to materialize chunks: would fetch too many chunk bytes: resource exhausted (used 1)"),
481+
expectedErr: fmt.Errorf("materializer failed to create chunks iterator: failed to create column value iterator: would fetch too many chunk bytes: resource exhausted (used 1)"),
482482
},
483483
"max chunk bytes per query limit hit": {
484484
limits: func() *validation.Overrides {

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

Lines changed: 43 additions & 9 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/queryable/parquet_queryable.go

Lines changed: 31 additions & 15 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/schema/schema.go

Lines changed: 2 additions & 1 deletion
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/schema/schema_builder.go

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

0 commit comments

Comments
 (0)