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/column_ref.go

45 lines
994 B

package logical
import (
"github.com/grafana/loki/v3/pkg/engine/internal/types"
"github.com/grafana/loki/v3/pkg/engine/planner/schema"
)
// A ColumnRef referenes a column within a table relation. ColumnRef only
// implements [Value].
type ColumnRef struct {
Ref types.ColumnRef
}
var (
_ Value = (*ColumnRef)(nil)
)
// Name returns the identifier of the ColumnRef, which combines the column type
// and column name being referenced.
func (c *ColumnRef) Name() string {
return c.Ref.String()
}
// String returns [ColumnRef.Name].
func (c *ColumnRef) String() string {
return c.Ref.String()
}
// Schema returns the schema of the column being referenced.
func (c *ColumnRef) Schema() *schema.Schema {
// TODO(rfratto): Update *schema.Schema to allow representing a single
// column.
return nil
}
func (c *ColumnRef) isValue() {}
func NewColumnRef(name string, ty types.ColumnType) *ColumnRef {
return &ColumnRef{
Ref: types.ColumnRef{
Column: name,
Type: ty,
},
}
}