public class QDictionary extends ADictionary
Constructor and Description |
---|
QDictionary(BitmapLossy bm) |
Modifier and Type | Method and Description |
---|---|
double |
aggregate(double init,
Builtin fn)
Aggregate all the contained values, useful in value only computations where the operation is iterating through
all values contained in the dictionary.
|
QDictionary |
apply(ScalarOperator op)
Applies the scalar operation on the dictionary.
|
QDictionary |
applyScalarOp(ScalarOperator op,
double newVal,
int numCols)
Applies the scalar operation on the dictionary.
|
QDictionary |
clone()
Returns a deep clone of the dictionary.
|
long |
getExactSizeOnDisk()
Calculate the space consumption if the dictionary is stored on disk.
|
long |
getInMemorySize()
Returns the memory usage of the dictionary.
|
static long |
getInMemorySize(int valuesCount) |
int |
getNumberOfValues(int nCol)
Get the number of values given that the column group has n columns
|
double |
getScale() |
double |
getValue(int i)
Get Specific value contained in the dictionary at index.
|
byte |
getValueByte(int i) |
double[] |
getValues()
Get all the values contained in the dictionary as a linearized double array.
|
byte[] |
getValuesByte() |
int |
getValuesLength()
returns the count of values contained in the dictionary.
|
int |
hasZeroTuple(int ncol)
Determines if the content has a zero tuple.
|
static QDictionary |
read(DataInput in) |
void |
write(DataOutput out)
Write the dictionary to a DataOutput.
|
aggregateCols, read
public QDictionary(BitmapLossy bm)
public double[] getValues()
ADictionary
getValues
in class ADictionary
public double getValue(int i)
ADictionary
getValue
in class ADictionary
i
- The index to extract the value frompublic byte getValueByte(int i)
public byte[] getValuesByte()
public double getScale()
public long getInMemorySize()
ADictionary
getInMemorySize
in class ADictionary
public static long getInMemorySize(int valuesCount)
public int hasZeroTuple(int ncol)
ADictionary
hasZeroTuple
in class ADictionary
ncol
- The number of columns in the dictionary.public double aggregate(double init, Builtin fn)
ADictionary
aggregate
in class ADictionary
init
- The initial Value, in cases such as Max value, this could be -infinityfn
- The Function to apply to valuespublic QDictionary apply(ScalarOperator op)
ADictionary
apply
in class ADictionary
op
- The operator to apply to the dictionary values.public QDictionary applyScalarOp(ScalarOperator op, double newVal, int numCols)
ADictionary
applyScalarOp
in class ADictionary
op
- The operator to apply to the dictionary values.newVal
- The value to append to the dictionary.numCols
- The number of columns stored in the dictionary.public int getValuesLength()
ADictionary
getValuesLength
in class ADictionary
public QDictionary clone()
ADictionary
clone
in class ADictionary
public static QDictionary read(DataInput in) throws IOException
IOException
public void write(DataOutput out) throws IOException
ADictionary
write
in class ADictionary
out
- the output sink to write the dictionary to.IOException
- if the sink fails.public long getExactSizeOnDisk()
ADictionary
getExactSizeOnDisk
in class ADictionary
public int getNumberOfValues(int nCol)
ADictionary
getNumberOfValues
in class ADictionary
nCol
- The number of Columns in the ColumnGroup.Copyright © 2020 The Apache Software Foundation. All rights reserved.