Documentation ¶
Index ¶
Constants ¶
const ( LEFT_EXPR = iota + 1 RIGHT_EXPR )
const (
POW = "pow"
)
Variables ¶
var (
ErrPromExprNotSupported = errors.New("unsupported expression")
)
var YieldsFloat = yieldsFloat
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition influxql.BinaryExpr
type Transpiler ¶
Transpiler is responsible for transpiling a single PromQL expression to InfluxQL expression. It will be gc-ed after its work done.
func (*Transpiler) NewBinaryCallExpr ¶
NewBinaryCallExpr creates a pointer to influxql.Call
func (*Transpiler) NewBinaryExpr ¶
NewBinaryExpr creates a pointer to influxql.BinaryExpr
func (*Transpiler) Transpile ¶
Transpile converts a PromQL expression with the time ranges set in the transpiler into an InfluxQL expression. The resulting InfluxQL expression can be executed and the result needs to be transformed using InfluxResultToPromQLValue() (implemented in the promql package of this repo) to get a result value that is fully equivalent to the result of a native PromQL execution.
During the transpiling procedure, the transpiler recursively translates the PromQL AST into equivalent InfluxQL AST.