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/columnar/recordbatch.go

34 lines
845 B

package columnar
// RecordBatch is a collection of equal-length arrays.
// This corresponds to the RecordBatch concept in the Arrow specification.
type RecordBatch struct {
// TODO(ivkalita): add schema?
nrows int64
arrs []Array
}
// NewRecordBatch returns a new RecordBatch created from the provided arrays.
// nrows specifies the total number of rows in the batch.
func NewRecordBatch(nrows int64, arrs []Array) RecordBatch {
return RecordBatch{
nrows: nrows,
arrs: arrs,
}
}
// NumRows returns the number of rows in the batch.
func (rb RecordBatch) NumRows() int64 {
return rb.nrows
}
// NumCols returns the number of columns in the batch.
func (rb RecordBatch) NumCols() int64 {
return int64(len(rb.arrs))
}
// Column returns the column array at index i.
func (rb RecordBatch) Column(i int64) Array {
return rb.arrs[i]
}