Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removes duplicate logRangeExprExt grammar #1651

Merged
merged 2 commits into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pkg/ingester/flush_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestFlushMaxAge(t *testing.T) {

// assert stream is now both batches
store.checkData(t, map[string][]*logproto.Stream{
userID: []*logproto.Stream{
userID: {
{Labels: model.LabelSet{"app": "l"}.String(), Entries: append(firstEntries, secondEntries...)},
},
})
Expand Down
4 changes: 2 additions & 2 deletions pkg/ingester/ingester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/weaveworks/common/httpgrpc"
"github.com/weaveworks/common/user"
"golang.org/x/net/context"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"

"github.com/cortexproject/cortex/pkg/chunk"
"github.com/cortexproject/cortex/pkg/util/flagext"
Expand Down Expand Up @@ -253,7 +253,7 @@ type mockQuerierServer struct {
grpc.ServerStream
}

func (*mockQuerierServer) SetTrailer(metadata.MD){}
func (*mockQuerierServer) SetTrailer(metadata.MD) {}

func (m *mockQuerierServer) Send(resp *logproto.QueryResponse) error {
m.resps = append(m.resps, resp)
Expand Down
1 change: 1 addition & 0 deletions pkg/logql/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ func (e *vectorAggregationExpr) String() string {
}

// helper used to impl Stringer for vector and range aggregations
// nolint:interfacer
func formatOperation(op string, grouping *grouping, params ...string) string {
nonEmptyParams := make([]string, 0, len(params))
for _, p := range params {
Expand Down
15 changes: 4 additions & 11 deletions pkg/logql/expr.y
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
Labels []string
LogExpr LogSelectorExpr
LogRangeExpr *logRange
LogRangeExprExt *logRange
Matcher *labels.Matcher
Matchers []*labels.Matcher
RangeAggregationExpr SampleExpr
Expand All @@ -34,7 +33,6 @@ import (
%type <Grouping> grouping
%type <Labels> labels
%type <LogExpr> logExpr
%type <LogRangeExprExt> logRangeExprExt
%type <LogRangeExpr> logRangeExpr
%type <Matcher> matcher
%type <Matchers> matchers
Expand Down Expand Up @@ -69,15 +67,10 @@ logExpr:

logRangeExpr:
logExpr DURATION { $$ = newLogRange($1, $2) } // <selector> <filters> <range>
| logRangeExprExt { $$ = $1 } // <selector> <range> <filters>
;

logRangeExprExt:
selector DURATION { $$ = newLogRange(newMatcherExpr($1), $2)}
| logRangeExprExt filter STRING { $$ = addFilterToLogRangeExpr( $1, $2, $3 ) }
| OPEN_PARENTHESIS logRangeExprExt CLOSE_PARENTHESIS { $$ = $2 }
| logRangeExprExt filter error
| logRangeExprExt error
| logRangeExpr filter STRING { $$ = addFilterToLogRangeExpr( $1, $2, $3 ) }
| OPEN_PARENTHESIS logRangeExpr CLOSE_PARENTHESIS { $$ = $2 }
| logRangeExpr filter error
| logRangeExpr error
;

rangeAggregationExpr: rangeOp OPEN_PARENTHESIS logRangeExpr CLOSE_PARENTHESIS { $$ = newRangeAggregationExpr($3,$1) };
Expand Down
Loading