@@ -60,15 +60,12 @@ func newOperator(expr parser.Expr, storage *engstore.SelectorPool, opts *query.O
60
60
case * parser.NumberLiteral :
61
61
return scan .NewNumberLiteralSelector (model .NewVectorPool (opts .StepsBatch ), opts , e .Val ), nil
62
62
case * logicalplan.VectorSelector :
63
- op , err := newVectorSelector (e , storage , opts , hints )
64
- if err != nil {
65
- return nil , err
66
- }
63
+ op := newVectorSelector (e , storage , opts , hints )
67
64
if e .SelectTimestamp {
68
65
// we will drop the __name__ label here, so we need to check for duplicate labels
69
66
return exchange .NewDuplicateLabelCheck (op , opts ), nil
70
67
}
71
- return op , err
68
+ return op , nil
72
69
case * parser.Call :
73
70
op , err := newCall (e , storage , opts , hints )
74
71
if err != nil {
@@ -110,7 +107,7 @@ func newOperator(expr parser.Expr, storage *engstore.SelectorPool, opts *query.O
110
107
}
111
108
}
112
109
113
- func newVectorSelector (e * logicalplan.VectorSelector , storage * engstore.SelectorPool , opts * query.Options , hints storage.SelectHints ) ( model.VectorOperator , error ) {
110
+ func newVectorSelector (e * logicalplan.VectorSelector , storage * engstore.SelectorPool , opts * query.Options , hints storage.SelectHints ) model.VectorOperator {
114
111
start , end := getTimeRangesForVectorSelector (e , opts , 0 )
115
112
hints .Start = start
116
113
hints .End = end
@@ -132,7 +129,7 @@ func newVectorSelector(e *logicalplan.VectorSelector, storage *engstore.Selector
132
129
operators = append (operators , exchange .NewConcurrent (operator , 2 , opts ))
133
130
}
134
131
135
- return exchange .NewCoalesce (model .NewVectorPool (opts .StepsBatch ), opts , batchsize * int64 (numShards ), operators ... ), nil
132
+ return exchange .NewCoalesce (model .NewVectorPool (opts .StepsBatch ), opts , batchsize * int64 (numShards ), operators ... )
136
133
}
137
134
138
135
func newCall (e * parser.Call , storage * engstore.SelectorPool , opts * query.Options , hints storage.SelectHints ) (model.VectorOperator , error ) {
@@ -143,28 +140,6 @@ func newCall(e *parser.Call, storage *engstore.SelectorPool, opts *query.Options
143
140
if e .Func .Name == "absent_over_time" {
144
141
return newAbsentOverTimeOperator (e , storage , opts , hints )
145
142
}
146
- if e .Func .Name == "timestamp" {
147
- switch arg := e .Args [0 ].(type ) {
148
- case * logicalplan.VectorSelector :
149
- arg .SelectTimestamp = true
150
- return newVectorSelector (arg , storage , opts , hints )
151
- case * parser.StepInvariantExpr :
152
- // Step invariant expressions on vector selectors need to be unwrapped so that we
153
- // can return the original timestamp rather than the step invariant one.
154
- switch vs := arg .Expr .(type ) {
155
- case * logicalplan.VectorSelector :
156
- // Prometheus weirdness.
157
- if vs .Timestamp != nil {
158
- vs .OriginalOffset = 0
159
- }
160
- vs .SelectTimestamp = true
161
- return newVectorSelector (vs , storage , opts , hints )
162
- }
163
- return newInstantVectorFunction (e , storage , opts , hints )
164
- }
165
- return newInstantVectorFunction (e , storage , opts , hints )
166
- }
167
-
168
143
// TODO(saswatamcode): Range vector result might need new operator
169
144
// before it can be non-nested. https://github.com/thanos-io/promql-engine/issues/39
170
145
for i := range e .Args {
0 commit comments