Documentation ¶
Index ¶
- func ClearBits(foundSet, target *roaring.Bitmap)
- type BSI
- func (b *BSI) Add(other *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) Clone() *BSI
- func (b *BSI) CompareValue(parallelism int, op Operation, valueOrStart, end int64, ...) *roaring.Bitmap
- func (b *BSI) GetCardinality() uint64
- func (b *BSI) GetExistenceBitmap() *roaring.Bitmap
- func (b *BSI) GetValue(columnID uint64) (int64, bool)
- func (b *BSI) HasRunCompression() bool
- func (b *BSI) Increment(foundSet *roaring.Bitmap)
- func (b *BSI) IncrementAll()
- func (b *BSI) IntersectAndTranspose(parallelism int, foundSet *roaring.Bitmap) *roaring.Bitmap
- func (b *BSI) MarshalBinary() ([][]byte, error)
- func (b *BSI) NewBSIRetainSet(foundSet *roaring.Bitmap) *BSI
- func (b *BSI) ParOr(parallelism int, bsis ...*BSI)
- func (b *BSI) RunOptimize()
- 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) TransposeWithCounts(parallelism int, foundSet *roaring.Bitmap) *BSI
- 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 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) Add ¶ added in v0.5.2
Add - In-place sum the contents of another BSI with this BSI, column wise.
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 values 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) GetExistenceBitmap ¶ added in v0.5.2
GetExistenceBitmap returns a pointer to the underlying existence bitmap of the BSI
func (*BSI) GetValue ¶
GetValue gets the value at the column ID. Second param will be false for non-existant values.
func (*BSI) HasRunCompression ¶ added in v0.5.2
HasRunCompression returns true if the bitmap benefits from run compression
func (*BSI) Increment ¶ added in v0.5.2
Increment - In-place increment of values in a BSI. Found set select columns for incrementing.
func (*BSI) IncrementAll ¶ added in v0.5.2
func (b *BSI) IncrementAll()
IncrementAll - In-place increment of all values in a BSI.
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) NewBSIRetainSet ¶ added in v0.5.1
NewBSIRetainSet - Construct a new BSI from a clone of existing BSI, retain only values contained in foundSet
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) RunOptimize ¶ added in v0.5.2
func (b *BSI) RunOptimize()
RunOptimize attempts to further compress the runs of consecutive values found in the bitmap
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) TransposeWithCounts ¶ added in v0.5.2
TransposeWithCounts is a matrix transpose function that returns a BSI that has a columnID system defined by the values contained within the input BSI. Given that for BSIs, different columnIDs can have the same value. TransposeWithCounts is useful for situations where there is a one-to-many relationship between the vectored integer sets. The resulting BSI contains the number of times a particular value appeared in the input BSI as an integer count.
func (*BSI) UnmarshalBinary ¶
UnmarshalBinary de-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.