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/compute/selection.go

19 lines
578 B

package compute
import (
"github.com/grafana/loki/v3/pkg/columnar"
"github.com/grafana/loki/v3/pkg/memory"
)
// applySelectionToBoolArray applies a selection bitmap to a boolean array,
// marking unselected rows as null in the result.
func applySelectionToBoolArray(alloc *memory.Allocator, arr *columnar.Bool, selection memory.Bitmap) (*columnar.Bool, error) {
if selection.Len() == 0 {
return arr, nil
}
validity, err := computeValidityAA(alloc, arr.Validity(), selection)
if err != nil {
return nil, err
}
return columnar.NewBool(arr.Values(), validity), nil
}