Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/pkg/engine/planner/logical/node_maketable.go

49 lines
1.3 KiB

package logical
import (
"fmt"
"github.com/grafana/loki/v3/pkg/engine/planner/schema"
)
// The MakeTable instruction yields a table relation from an identifier.
// MakeTable implements both [Instruction] and [Value].
type MakeTable struct {
id string
// Selector is used to generate a table relation. All streams for which the
// selector passes are included in the resulting table.
//
// It is invalid for Selector to include a [ColumnRef] that is not
// [ColumnTypeBuiltin] or [ColumnTypeLabel].
Selector Value
}
var (
_ Value = (*MakeTable)(nil)
_ Instruction = (*MakeTable)(nil)
)
// Name returns an identifier for the MakeTable operation.
func (t *MakeTable) Name() string {
if t.id != "" {
return t.id
}
return fmt.Sprintf("%p", t)
}
// String returns the disassembled SSA form of the MakeTable instruction.
func (t *MakeTable) String() string {
return fmt.Sprintf("MAKETABLE [selector=%s]", t.Selector.Name())
}
// Schema returns the schema of the table.
// This implements part of the Plan interface.
func (t *MakeTable) Schema() *schema.Schema {
// TODO(rfratto): What should we return here? What's possible for the logical
// planner to know about the selector at planning time?
return nil
}
func (t *MakeTable) isInstruction() {}
func (t *MakeTable) isValue() {}