Documentation ¶
Index ¶
- func ClearBits(foundSet, target *roaring.Bitmap)
- type BSI
- func (b *BSI) BatchEqual(parallelism int, values []int64) *roaring.Bitmap
- func (b *BSI) BitCount() int
- func (b *BSI) ClearValues(foundSet *roaring.Bitmap)
- func (b *BSI) CompareValue(parallelism int, op Operation, valueOrStart, end int64, ...) *roaring.Bitmap
- func (b *BSI) GetCardinality() uint64
- func (b *BSI) GetValue(columnID uint64) (int64, bool)
- func (b *BSI) IntersectAndTranspose(parallelism int, foundSet *roaring.Bitmap) *roaring.Bitmap
- func (b *BSI) MarshalBinary() ([][]byte, error)
- func (b *BSI) ParOr(parallelism int, bsis ...*BSI)
- func (b *BSI) SetValue(columnID uint64, value int64)
- func (b *BSI) Sum(foundSet *roaring.Bitmap) (sum int64, count uint64)
- func (b *BSI) Transpose() *roaring.Bitmap
- func (b *BSI) UnmarshalBinary(bitData [][]byte) error
- func (b *BSI) ValueExists(columnID uint64) bool
- type Operation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BSI ¶
BSI is at its simplest is an array of bitmaps that represent an encoded binary value. The advantage of a BSI is that comparisons can be made across ranges of values whereas a bitmap can only represent the existence of a single value for a given column ID. Another usage scenario involves storage of high cardinality values.
It depends upon the roaring bitmap libraries. It is not thread safe, so upstream concurrency guards must be provided.
func NewBSI ¶
NewBSI constructs a new BSI. Min/Max values are optional. If set to 0 then the underlying BSI will be automatically sized.
func (*BSI) BatchEqual ¶
BatchEqual returns a bitmap containing the column IDs where the values are contained within the list of values provided.
func (*BSI) ClearValues ¶
ClearValues removes the vallues found in foundSet
func (*BSI) CompareValue ¶
func (b *BSI) CompareValue(parallelism int, op Operation, valueOrStart, end int64, foundSet *roaring.Bitmap) *roaring.Bitmap
CompareValue compares value. For all operations with the exception of RANGE, the value to be compared is specified by valueOrStart. For the RANGE parameter the comparison criteria is >= valueOrStart and <= end. The parallelism parameter indicates the number of CPU threads to be applied for processing. A value of zero indicates that all available CPU resources will be potentially utilized.
func (*BSI) GetCardinality ¶
GetCardinality returns a count of unique column IDs for which a value has been set.
func (*BSI) GetValue ¶
GetValue gets the value at the column ID. Second param will be false for non-existant values.
func (*BSI) IntersectAndTranspose ¶
IntersectAndTranspose is a matrix transpose function. Return a bitmap such that the values are represented as column IDs in the returned bitmap. This is accomplished by iterating over the foundSet and only including the column IDs in the source (foundSet) as compared with this BSI. This can be useful for vectoring one set of integers to another.
func (*BSI) MarshalBinary ¶
MarshalBinary serializes a BSI
func (*BSI) ParOr ¶
ParOr is intended primarily to be a concatenation function to be used during bulk load operations. Care should be taken to make sure that columnIDs do not overlap (unless overlapping values are identical).
func (*BSI) Sum ¶
Sum all values contained within the foundSet. As a convenience, the cardinality of the foundSet is also returned (for calculating the average).
func (*BSI) UnmarshalBinary ¶
UnmarshalBinary se-serialize a BSI. The value at bitData[0] is the EBM. Other indices are in least to most significance order starting at bitData[1] (bit position 0).
func (*BSI) ValueExists ¶
ValueExists tests whether the value exists.