Class ValueStore
java.lang.Object
io.trino.operator.aggregation.histogram.ValueStore
helper class for
GroupedTypedHistogram
May be used for other cases that need a simple hash for values
sort of a FlyWeightStore for values--will return unique number for a value. If it exists, you'll get the same number. Class map Value -> number
Note it assumes you're storing # -> Value (Type, Block, position, or the result of the ) somewhere else
-
Constructor Summary
ConstructorsConstructorDescriptionValueStore(Type type, BlockTypeOperators.BlockPositionEqual equalOperator, int expectedSize, BlockBuilder values) -
Method Summary
Modifier and TypeMethodDescriptionintaddAndGetPosition(Block block, int position, long valueHash) This will add an item if not already in the system.longint
-
Constructor Details
-
ValueStore
public ValueStore(Type type, BlockTypeOperators.BlockPositionEqual equalOperator, int expectedSize, BlockBuilder values)
-
-
Method Details
-
addAndGetPosition
This will add an item if not already in the system. It returns a pointer that is unique for multiple instances of the value. If item present, returns the pointer into the system -
getRehashCount
public int getRehashCount() -
getEstimatedSize
public long getEstimatedSize()
-