@@ -2,14 +2,17 @@ package engine_test
22
33import (
44 "context"
5- "errors"
65 "fmt"
76 "math/rand"
87 "strconv"
98 "testing"
109 "time"
1110
11+ "github.com/thanos-io/promql-engine/engine"
12+ "github.com/thanos-io/promql-engine/logicalplan"
13+
1214 "github.com/cortexproject/promqlsmith"
15+ "github.com/efficientgo/core/errors"
1316 "github.com/efficientgo/core/testutil"
1417 "github.com/google/go-cmp/cmp"
1518 "github.com/prometheus/prometheus/model/labels"
@@ -19,8 +22,6 @@ import (
1922 "github.com/prometheus/prometheus/storage"
2023 "github.com/prometheus/prometheus/tsdb/chunkenc"
2124 "github.com/prometheus/prometheus/util/annotations"
22- "github.com/thanos-io/promql-engine/engine"
23- "github.com/thanos-io/promql-engine/logicalplan"
2425)
2526
2627type projectionQuerier struct {
@@ -88,7 +89,7 @@ func (m projectionSeriesSet) At() storage.Series {
8889 }
8990}
9091
91- // projectedSeries wraps a storage.Series but returns projected labels
92+ // projectedSeries wraps a storage.Series but returns projected labels.
9293type projectedSeries struct {
9394 storage.Series
9495 lset labels.Labels
@@ -105,7 +106,7 @@ func (s *projectedSeries) Iterator(iter chunkenc.Iterator) chunkenc.Iterator {
105106func (m projectionSeriesSet ) Err () error { return m .SeriesSet .Err () }
106107func (m projectionSeriesSet ) Warnings () annotations.Annotations { return m .SeriesSet .Warnings () }
107108
108- // Implement the Querier interface methods
109+ // Implement the Querier interface methods.
109110func (m * projectionQuerier ) Select (ctx context.Context , sortSeries bool , hints * storage.SelectHints , matchers ... * labels.Matcher ) storage.SeriesSet {
110111 return projectionSeriesSet {
111112 SeriesSet : m .Querier .Select (ctx , sortSeries , hints , matchers ... ),
@@ -120,7 +121,7 @@ func (m *projectionQuerier) LabelNames(ctx context.Context, _ *storage.LabelHint
120121}
121122func (m * projectionQuerier ) Close () error { return nil }
122123
123- // projectionQueryable is a storage.Queryable that applies projection to the querier
124+ // projectionQueryable is a storage.Queryable that applies projection to the querier.
124125type projectionQueryable struct {
125126 storage.Queryable
126127}
@@ -256,7 +257,7 @@ func TestProjectionPushdownWithFuzz(t *testing.T) {
256257 }
257258}
258259
259- // containsAggregationOrBinaryOperation checks if the expression contains any aggregation or binary operations
260+ // containsAggregationOrBinaryOperation checks if the expression contains any aggregation or binary operations.
260261func containsAggregationOrBinaryOperation (expr parser.Expr ) bool {
261262 found := false
262263 parser .Inspect (expr , func (node parser.Node , _ []parser.Node ) error {
0 commit comments