@@ -59,79 +59,44 @@ func New(ctx context.Context, expr logicalplan.Node, storage storage.Scanners, o
5959}
6060
6161func newOperator (ctx context.Context , expr logicalplan.Node , storage storage.Scanners , opts * query.Options , hints promstorage.SelectHints ) (model.VectorOperator , error ) {
62- span , ctx := tracing .StartSpanFromContext (ctx , "execution.newOperator" )
63- defer span .Finish ()
64- span .SetTag ("expr_type" , parser .DocumentedType (expr .ReturnType ()))
65- span .SetTag ("expr" , expr .String ())
66-
6762 switch e := expr .(type ) {
6863 case * logicalplan.NumberLiteral :
69- span .SetTag ("operator_type" , "number_literal" )
7064 return scan .NewNumberLiteralSelector (model .NewVectorPool (opts .StepsBatch ), opts , e .Val ), nil
7165 case * logicalplan.VectorSelector :
72- span .SetTag ("operator_type" , "vector_selector" )
7366 return newVectorSelector (ctx , e , storage , opts , hints )
7467 case * logicalplan.FunctionCall :
75- span .SetTag ("operator_type" , "function_call" )
76- span .SetTag ("function_name" , e .Func .Name )
7768 return newCall (ctx , e , storage , opts , hints )
7869 case * logicalplan.Aggregation :
79- span .SetTag ("operator_type" , "aggregation" )
80- span .SetTag ("aggregation_op" , e .Op .String ())
8170 return newAggregateExpression (ctx , e , storage , opts , hints )
8271 case * logicalplan.Binary :
83- span .SetTag ("operator_type" , "binary" )
84- span .SetTag ("binary_op" , e .Op .String ())
8572 return newBinaryExpression (ctx , e , storage , opts , hints )
8673 case * logicalplan.Parens :
87- span .SetTag ("operator_type" , "parens" )
8874 return newOperator (ctx , e .Expr , storage , opts , hints )
8975 case * logicalplan.Unary :
90- span .SetTag ("operator_type" , "unary" )
91- span .SetTag ("unary_op" , e .Op .String ())
9276 return newUnaryExpression (ctx , e , storage , opts , hints )
9377 case * logicalplan.StepInvariantExpr :
94- span .SetTag ("operator_type" , "step_invariant" )
9578 return newStepInvariantExpression (ctx , e , storage , opts , hints )
9679 case logicalplan.Deduplicate :
97- span .SetTag ("operator_type" , "deduplicate" )
9880 return newDeduplication (ctx , e , storage , opts , hints )
9981 case logicalplan.RemoteExecution :
100- span .SetTag ("operator_type" , "remote_execution" )
10182 return newRemoteExecution (ctx , e , opts , hints )
10283 case * logicalplan.CheckDuplicateLabels :
103- span .SetTag ("operator_type" , "check_duplicate_labels" )
10484 return newDuplicateLabelCheck (ctx , e , storage , opts , hints )
10585 case logicalplan.Noop :
106- span .SetTag ("operator_type" , "noop" )
10786 return noop .NewOperator (opts ), nil
10887 case logicalplan.UserDefinedExpr :
109- span .SetTag ("operator_type" , "user_defined" )
11088 return e .MakeExecutionOperator (ctx , model .NewVectorPool (opts .StepsBatch ), opts , hints )
11189 default :
112- err := errors .Wrapf (parse .ErrNotSupportedExpr , "got: %s (%T)" , e , e )
113- tracing .LogError (span , err )
114- return nil , err
90+ return nil , errors .Wrapf (parse .ErrNotSupportedExpr , "got: %s (%T)" , e , e )
11591 }
11692}
11793
11894func newVectorSelector (ctx context.Context , e * logicalplan.VectorSelector , scanners storage.Scanners , opts * query.Options , hints promstorage.SelectHints ) (model.VectorOperator , error ) {
119- span , ctx := tracing .StartSpanFromContext (ctx , "execution.newVectorSelector" )
120- defer span .Finish ()
121- span .SetTag ("vector_selector" , e .String ())
122-
12395 start , end := getTimeRangesForVectorSelector (e , opts , 0 )
12496 hints .Start = start
12597 hints .End = end
12698
127- span .SetTag ("start_time" , start )
128- span .SetTag ("end_time" , end )
129-
130- op , err := scanners .NewVectorSelector (ctx , opts , hints , * e )
131- if err != nil {
132- tracing .LogError (span , err )
133- }
134- return op , err
99+ return scanners .NewVectorSelector (ctx , opts , hints , * e )
135100}
136101
137102func newCall (ctx context.Context , e * logicalplan.FunctionCall , scanners storage.Scanners , opts * query.Options , hints promstorage.SelectHints ) (model.VectorOperator , error ) {
0 commit comments