MCPcopy
hub / github.com/grafana/tempo / newUnaryOperation

Function newUnaryOperation

pkg/traceql/ast.go:619–633  ·  view source on GitHub ↗
(op Operator, e FieldExpression)

Source from the content-addressed store, hash-verified

617}
618
619func newUnaryOperation(op Operator, e FieldExpression) FieldExpression {
620 unop := UnaryOperation{
621 Op: op,
622 Expression: e,
623 }
624
625 // AST rewrite for simplification
626 if !unop.referencesSpan() && unop.validate() == nil {
627 if simplified, err := unop.execute(nil); err == nil {
628 return simplified
629 }
630 }
631
632 return unop
633}
634
635// nolint: revive
636func (UnaryOperation) __fieldExpression() {}

Callers 5

ParseMethod · 0.85

Calls 3

referencesSpanMethod · 0.95
validateMethod · 0.95
executeMethod · 0.95