Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctrl *runtime.Controller, instanceID string, claims *runtime.SecurityClaims, priority int) *Compiler
New returns a compiler and created a tidb parser object. The instantiated parser object and thus compiler is not goroutine safe and not lightweight. It is better to keep it in a single goroutine, and reuse it if possible.
func (*Compiler) Rewrite ¶ added in v0.48.0
Rewrite parses a metrics SQL query and compiles it to a metricview.Query. It uses tidb parser(which is a MySQL compliant parser) and transforms over the generated AST to generate query. We use MySQL's ANSI sql Mode to conform more closely to standard SQL.
Whenever adding transform method over new node type also look at its `Restore` method to get an idea how it can be parsed into a SQL query.
Click to show internal directories.
Click to hide internal directories.