public final class ColumnVector extends Object implements AutoCloseable, BinaryOperable
| Modifier and Type | Class and Description |
|---|---|
static class |
ColumnVector.Builder
Build
|
protected static class |
ColumnVector.OffHeapState
Holds the off heap state of the column vector so we can clean it up, even if it is leaked.
|
| Modifier and Type | Method and Description |
|---|---|
ColumnVector |
abs()
Calculate the abs, output is the same type as input.
|
Scalar |
approxQuantile(double quantile)
Calculate the approximate quantile of this ColumnVector
|
ColumnVector |
arccos()
Calculate the arccos, output is the same type as input.
|
ColumnVector |
arcsin()
Calculate the arcsin, output is the same type as input.
|
ColumnVector |
arctan()
Calculate the arctan, output is the same type as input.
|
ColumnVector |
asBytes()
Cast to Byte - ColumnVector
This method takes the value provided by the ColumnVector and casts to byte
When casting from a Date, Timestamp, or Boolean to a byte type the underlying numerical
representation of the data will be used for the cast.
|
ColumnVector |
asDate32()
Cast to Date32 - ColumnVector
This method takes the value provided by the ColumnVector and casts to date32
|
ColumnVector |
asDate64()
Cast to Date64 - ColumnVector
This method takes the value provided by the ColumnVector and casts to date64
|
ColumnVector |
asDoubles()
Cast to Double - ColumnVector
This method takes the value provided by the ColumnVector and casts to double
When casting from a Date, Timestamp, or Boolean to a double type the underlying numerical
representation of the data will be used for the cast.
|
ColumnVector |
asFloats()
Cast to Float - ColumnVector
This method takes the value provided by the ColumnVector and casts to float
When casting from a Date, Timestamp, or Boolean to a float type the underlying numerical
representatio of the data will be used for the cast.
|
ColumnVector |
asInts()
Cast to Int - ColumnVector
This method takes the value provided by the ColumnVector and casts to int
When casting from a Date, Timestamp, or Boolean to a int type the underlying numerical
representation of the data will be used for the cast.
|
ColumnVector |
asLongs()
Cast to Long - ColumnVector
This method takes the value provided by the ColumnVector and casts to long
When casting from a Date, Timestamp, or Boolean to a long type the underlying numerical
representation of the data will be used for the cast.
|
ColumnVector |
asShorts()
Cast to Short - ColumnVector
This method takes the value provided by the ColumnVector and casts to short
When casting from a Date, Timestamp, or Boolean to a short type the underlying numerical
representation of the data will be used for the cast.
|
ColumnVector |
asStringCategories()
Cast to String Categories.
|
ColumnVector |
asStrings()
Cast to Strings.
|
ColumnVector |
asTimestamp(TimeUnit unit)
Cast to Timestamp - ColumnVector
This method takes the value provided by the ColumnVector and casts to timestamp
|
ColumnVector |
binaryOp(BinaryOp op,
BinaryOperable rhs,
DType outType)
Multiple different binary operations.
|
ColumnVector |
bitInvert()
invert the bits, output is the same type as input.
|
static ColumnVector |
boolFromBytes(byte... values)
Create a new vector from the given values.
|
static ColumnVector |
build(DType type,
int rows,
java.util.function.Consumer<ColumnVector.Builder> init)
Create a new vector.
|
static ColumnVector |
build(DType type,
int rows,
long stringBufferSize,
java.util.function.Consumer<ColumnVector.Builder> init) |
static ColumnVector |
build(DType type,
TimeUnit tsTimeUnit,
int rows,
java.util.function.Consumer<ColumnVector.Builder> init)
Create a new vector.
|
static ColumnVector.Builder |
builder(DType type,
int rows)
Create a new Builder to hold the specified number of rows.
|
static ColumnVector.Builder |
builder(DType type,
int rows,
long stringBufferSize)
Create a new Builder to hold the specified number of rows and with enough space to hold the
given amount of string data.
|
static ColumnVector.Builder |
builder(DType type,
TimeUnit tsTimeUnit,
int rows)
Create a new Builder to hold the specified number of rows.
|
static ColumnVector |
buildOnHost(DType type,
int rows,
java.util.function.Consumer<ColumnVector.Builder> init)
Create a new vector without sending data to the device.
|
static ColumnVector |
buildOnHost(DType type,
TimeUnit tsTimeUnit,
int rows,
java.util.function.Consumer<ColumnVector.Builder> init)
Create a new vector without sending data to the device.
|
ColumnVector |
castTo(DType type,
TimeUnit unit)
Generic method to cast ColumnVector
When casting from a Date, Timestamp, or Boolean to a numerical type the underlying numerical
representationof the data will be used for the cast.
|
static ColumnVector |
categoryFromStrings(String... values)
Create a new category string vector from the given values.
|
ColumnVector |
ceil()
Calculate the ceil, output is the same type as input.
|
void |
close()
Close this Vector and free memory allocated for HostMemoryBuffer and DeviceMemoryBuffer
|
static ColumnVector |
concatenate(ColumnVector... columns)
Create a new vector by concatenating multiple columns together.
|
ColumnVector |
cos()
Calculate the cos, output is the same type as input.
|
static ColumnVector |
datesFromBoxedInts(Integer... values)
Create a new vector from the given values.
|
static ColumnVector |
datesFromBoxedLongs(Long... values)
Create a new vector from the given values.
|
static ColumnVector |
datesFromInts(int... values)
Create a new vector from the given values.
|
static ColumnVector |
datesFromLongs(long... values)
Create a new vector from the given values.
|
ColumnVector |
day()
Get day from DATE32, DATE64, or TIMESTAMP
|
void |
ensureOnDevice()
Be sure the data is on the device.
|
void |
ensureOnHost()
Be sure the data is on the host.
|
Scalar |
exactQuantile(QuantileMethod method,
double quantile)
Calculate the quantile of this ColumnVector
|
ColumnVector |
exp()
Calculate the exp, output is the same type as input.
|
ColumnVector |
floor()
Calculate the floor, output is the same type as input.
|
static ColumnVector |
fromBoxedBooleans(Boolean... values)
Create a new vector from the given values.
|
static ColumnVector |
fromBoxedBytes(Byte... values)
Create a new vector from the given values.
|
static ColumnVector |
fromBoxedDoubles(Double... values)
Create a new vector from the given values.
|
static ColumnVector |
fromBoxedFloats(Float... values)
Create a new vector from the given values.
|
static ColumnVector |
fromBoxedInts(Integer... values)
Create a new vector from the given values.
|
static ColumnVector |
fromBoxedLongs(Long... values)
Create a new vector from the given values.
|
static ColumnVector |
fromBoxedShorts(Short... values)
Create a new vector from the given values.
|
static ColumnVector |
fromBytes(byte... values)
Create a new vector from the given values.
|
static ColumnVector |
fromDoubles(double... values)
Create a new vector from the given values.
|
static ColumnVector |
fromFloats(float... values)
Create a new vector from the given values.
|
static ColumnVector |
fromInts(int... values)
Create a new vector from the given values.
|
static ColumnVector |
fromLongs(long... values)
Create a new vector from the given values.
|
static ColumnVector |
fromScalar(Scalar scalar,
int rows)
Create a new vector of length rows, where each row is filled with the Scalar's
value
|
static ColumnVector |
fromShorts(short... values)
Create a new vector from the given values.
|
static ColumnVector |
fromStrings(String... values)
Create a new string vector from the given values.
|
boolean |
getBoolean(long index)
Get the boolean value at index
|
byte |
getByte(long index)
Get the value at index.
|
ColumnVector |
getByteCount()
Retrieve the number of bytes for each string.
|
Scalar |
getCategoryIndex(Scalar s)
Returns the category index of the specified string scalar.
|
double |
getDouble(long index)
Get the value at index.
|
float |
getFloat(long index)
Get the value at index.
|
int |
getInt(long index)
Get the value at index.
|
String |
getJavaString(long index)
Get the value at index.
|
ColumnVector |
getLengths()
Retrieve the number of characters in each string.
|
long |
getLong(long index)
Get the value at index.
|
long |
getNativeCudfColumnAddress()
USE WITH CAUTION: This method exposes the address of the native cudf_column.
|
long |
getNullCount()
Returns the number of nulls in the data.
|
long |
getRowCount()
Returns the number of rows in this vector.
|
short |
getShort(long index)
Get the value at index.
|
TimeUnit |
getTimeUnit()
For vector types that support a TimeUnit (TIMESTAMP),
get the unit of time.
|
DType |
getType()
Returns the type of this vector.
|
ColumnVector |
hash()
Compute the 32 bit hash of a vector.
|
ColumnVector |
hash(HashFunction func)
Compute a specific hash of a vector.
|
boolean |
hasNulls()
Returns if the vector has nulls.
|
boolean |
hasValidityVector()
Returns if the vector has a validity vector allocated or not.
|
ColumnVector |
hour()
Get hour from DATE64 or TIMESTAMP
|
ColumnVector |
identityHash()
Compute the IDENTITY hash of the column.
|
ColumnVector |
incRefCount()
Increment the reference count for this column.
|
ColumnVector |
isNotNull()
Returns a Boolean vector with the same number of rows as this instance, that has
TRUE for any entry that is not null, and FALSE for any null entry (as per the validity mask)
|
ColumnVector |
isNull()
Returns a Boolean vector with the same number of rows as this instance, that has
FALSE for any entry that is not null, and TRUE for any null entry (as per the validity mask)
|
boolean |
isNull(long index)
Check if the value at index is null or not.
|
ColumnVector |
log()
Calculate the log, output is the same type as input.
|
Scalar |
max()
Returns the maximum of all values in the column, returning a scalar
of the same type as this column.
|
Scalar |
max(DType outType)
Returns the maximum of all values in the column, returning a scalar
of the specified type.
|
Scalar |
min()
Returns the minimum of all values in the column, returning a scalar
of the same type as this column.
|
Scalar |
min(DType outType)
Returns the minimum of all values in the column, returning a scalar
of the specified type.
|
ColumnVector |
minute()
Get minute from DATE64 or TIMESTAMP
|
ColumnVector |
month()
Get month from DATE32, DATE64, or TIMESTAMP
|
ColumnVector |
murmur3()
Compute the MURMUR3 hash of the column.
|
ColumnVector |
not()
Returns a vector of the logical `not` of each value in the input
column (this)
|
void |
noWarnLeakExpected()
This is a really ugly API, but it is possible that the lifecycle of a column of
data may not have a clear lifecycle thanks to java and GC.
|
Scalar |
product()
Returns the product of all values in the column, returning a scalar
of the same type as this column.
|
Scalar |
product(DType outType)
Returns the product of all values in the column, returning a scalar
of the specified type.
|
Scalar |
reduce(ReductionOp op)
Computes the reduction of the values in all rows of a column.
|
Scalar |
reduce(ReductionOp op,
DType outType)
Computes the reduction of the values in all rows of a column.
|
ColumnVector |
replaceNulls(Scalar scalar)
Returns a ColumnVector with any null values replaced with a scalar.
|
ColumnVector |
second()
Get second from DATE64 or TIMESTAMP
|
ColumnVector |
sin()
Calculate the sin, output is the same type as input.
|
ColumnVector[] |
slice(ColumnVector indices)
Slices a column (including null values) into a set of columns
according to a set of indices.
|
ColumnVector[] |
slice(int... indices)
Slices a column (including null values) into a set of columns
according to a set of indices.
|
ColumnVector |
sqrt()
Calculate the sqrt, output is the same type as input.
|
Scalar |
standardDeviation()
Returns the sample standard deviation of all values in the column,
returning a FLOAT64 scalar unless the column type is FLOAT32 then
a FLOAT32 scalaris returned.
|
Scalar |
standardDeviation(DType outType)
Returns the sample standard deviation of all values in the column,
returning a scalar of the specified type.
|
Scalar |
sum()
Computes the sum of all values in the column, returning a scalar
of the same type as this column.
|
Scalar |
sum(DType outType)
Computes the sum of all values in the column, returning a scalar
of the specified type.
|
Scalar |
sumOfSquares()
Returns the sum of squares of all values in the column, returning a
scalar of the same type as this column.
|
Scalar |
sumOfSquares(DType outType)
Returns the sum of squares of all values in the column, returning a
scalar of the specified type.
|
ColumnVector |
tan()
Calculate the tan, output is the same type as input.
|
static ColumnVector |
timestampsFromBoxedLongs(Long... values)
Create a new vector from the given values.
|
static ColumnVector |
timestampsFromBoxedLongs(TimeUnit tsTimeUnit,
Long... values)
Create a new vector from the given values.
|
static ColumnVector |
timestampsFromLongs(long... values)
Create a new vector from the given values.
|
static ColumnVector |
timestampsFromLongs(TimeUnit tsTimeUnit,
long... values)
Create a new vector from the given values.
|
String |
toString() |
ColumnVector |
unaryOp(UnaryOp op)
Multiple different unary operations.
|
ColumnVector |
year()
Get year from DATE32, DATE64, or TIMESTAMP
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, add, and, and, bitAnd, bitAnd, bitOr, bitOr, bitXor, bitXor, div, div, equalTo, equalTo, floorDiv, floorDiv, greaterOrEqualTo, greaterOrEqualTo, greaterThan, greaterThan, implicitConversion, lessOrEqualTo, lessOrEqualTo, lessThan, lessThan, mod, mod, mul, mul, notEqualTo, notEqualTo, or, or, pow, pow, sub, sub, trueDiv, trueDivpublic final void noWarnLeakExpected()
public final void close()
close in interface AutoCloseablepublic ColumnVector incRefCount()
public long getRowCount()
public ColumnVector getLengths()
public ColumnVector hash()
public ColumnVector hash(HashFunction func)
func - the has function to use.public ColumnVector murmur3()
public ColumnVector identityHash()
public DType getType()
getType in interface BinaryOperablepublic long getNullCount()
public ColumnVector getByteCount()
public boolean hasValidityVector()
public boolean hasNulls()
public TimeUnit getTimeUnit()
public final void ensureOnDevice()
public final void ensureOnHost()
public boolean isNull(long index)
public ColumnVector isNotNull()
public ColumnVector isNull()
public ColumnVector replaceNulls(Scalar scalar)
scalar - - Scalar value to use as replacementpublic byte getByte(long index)
public final short getShort(long index)
public final int getInt(long index)
public final long getLong(long index)
public final float getFloat(long index)
public final double getDouble(long index)
public final boolean getBoolean(long index)
public String getJavaString(long index)
public ColumnVector year()
Postconditions - A new vector is allocated with the result. The caller owns the vector and is responsible for its lifecycle.
public ColumnVector month()
Postconditions - A new vector is allocated with the result. The caller owns the vector and is responsible for its lifecycle.
public ColumnVector day()
Postconditions - A new vector is allocated with the result. The caller owns the vector and is responsible for its lifecycle.
public ColumnVector hour()
Postconditions - A new vector is allocated with the result. The caller owns the vector and is responsible for its lifecycle.
public ColumnVector minute()
Postconditions - A new vector is allocated with the result. The caller owns the vector and is responsible for its lifecycle.
public ColumnVector second()
Postconditions - A new vector is allocated with the result. The caller owns the vector and is responsible for its lifecycle.
public ColumnVector unaryOp(UnaryOp op)
op - the operation to performpublic ColumnVector sin()
public ColumnVector cos()
public ColumnVector tan()
public ColumnVector arcsin()
public ColumnVector arccos()
public ColumnVector arctan()
public ColumnVector exp()
public ColumnVector log()
public ColumnVector sqrt()
public ColumnVector ceil()
public ColumnVector floor()
public ColumnVector abs()
public ColumnVector bitInvert()
public ColumnVector binaryOp(BinaryOp op, BinaryOperable rhs, DType outType)
binaryOp in interface BinaryOperableop - the operation to performrhs - the rhs of the operationoutType - the type of output you want.public ColumnVector[] slice(int... indices)
indices - public ColumnVector[] slice(ColumnVector indices)
indices - public Scalar sum()
public Scalar sum(DType outType)
public Scalar min()
public Scalar min(DType outType)
public Scalar max()
public Scalar max(DType outType)
public Scalar product()
public Scalar product(DType outType)
public Scalar sumOfSquares()
public Scalar sumOfSquares(DType outType)
public Scalar standardDeviation()
public Scalar standardDeviation(DType outType)
public Scalar reduce(ReductionOp op)
op - The reduction operation to performScalar.isValid() method of the result will return false.public Scalar reduce(ReductionOp op, DType outType)
op - The reduction operation to performoutType - The type of scalar value to returnScalar.isValid() method of the result will return false.public ColumnVector not()
public ColumnVector castTo(DType type, TimeUnit unit)
type - type of the resulting ColumnVectorunit - the unit of time, really only applicable for TIMESTAMP.public ColumnVector asBytes()
public ColumnVector asShorts()
public ColumnVector asInts()
public ColumnVector asLongs()
public ColumnVector asFloats()
public ColumnVector asDoubles()
public ColumnVector asDate32()
public ColumnVector asDate64()
public ColumnVector asTimestamp(TimeUnit unit)
public ColumnVector asStrings()
public ColumnVector asStringCategories()
public Scalar getCategoryIndex(Scalar s)
s - a Scalar of type DType.STRING to lookupScalar containing the category index or -1
if the string was not found in the category.public final long getNativeCudfColumnAddress()
public static ColumnVector.Builder builder(DType type, int rows)
#build(int, Consumer) instead to avoid needing to
close the builder.type - the type of vector to build.rows - the number of rows this builder can holdpublic static ColumnVector.Builder builder(DType type, TimeUnit tsTimeUnit, int rows)
#build(int, Consumer) instead to avoid needing to
close the builder.type - the type of vector to build.rows - the number of rows this builder can holdpublic static ColumnVector.Builder builder(DType type, int rows, long stringBufferSize)
#build(int, int, Consumer) instead to avoid needing to close the builder.type - the type of vector to build.rows - the number of rows this builder can holdstringBufferSize - the size of the string buffer to allocate.public static ColumnVector build(DType type, int rows, java.util.function.Consumer<ColumnVector.Builder> init)
type - the type of vector to build.rows - maximum number of rows that the vector can hold.init - what will initialize the vector.public static ColumnVector build(DType type, TimeUnit tsTimeUnit, int rows, java.util.function.Consumer<ColumnVector.Builder> init)
type - the type of vector to build.tsTimeUnit - the unit of time, really only applicable for TIMESTAMP.rows - maximum number of rows that the vector can hold.init - what will initialize the vector.public static ColumnVector build(DType type, int rows, long stringBufferSize, java.util.function.Consumer<ColumnVector.Builder> init)
public static ColumnVector buildOnHost(DType type, int rows, java.util.function.Consumer<ColumnVector.Builder> init)
type - the type of vector to build.rows - maximum number of rows that the vector can hold.init - what will initialize the vector.public static ColumnVector buildOnHost(DType type, TimeUnit tsTimeUnit, int rows, java.util.function.Consumer<ColumnVector.Builder> init)
type - the type of vector to build.tsTimeUnit - the unit of time, really only applicable for TIMESTAMP.rows - maximum number of rows that the vector can hold.init - what will initialize the vector.public static ColumnVector boolFromBytes(byte... values)
public static ColumnVector fromBytes(byte... values)
public static ColumnVector fromShorts(short... values)
public static ColumnVector fromInts(int... values)
public static ColumnVector fromLongs(long... values)
public static ColumnVector fromFloats(float... values)
public static ColumnVector fromDoubles(double... values)
public static ColumnVector datesFromInts(int... values)
public static ColumnVector datesFromLongs(long... values)
public static ColumnVector timestampsFromLongs(long... values)
public static ColumnVector timestampsFromLongs(TimeUnit tsTimeUnit, long... values)
public static ColumnVector categoryFromStrings(String... values)
public static ColumnVector fromStrings(String... values)
public static ColumnVector fromBoxedBooleans(Boolean... values)
public static ColumnVector fromBoxedBytes(Byte... values)
public static ColumnVector fromBoxedShorts(Short... values)
public static ColumnVector fromBoxedInts(Integer... values)
public static ColumnVector fromBoxedLongs(Long... values)
public static ColumnVector fromBoxedFloats(Float... values)
public static ColumnVector fromBoxedDoubles(Double... values)
public static ColumnVector datesFromBoxedInts(Integer... values)
public static ColumnVector datesFromBoxedLongs(Long... values)
public static ColumnVector timestampsFromBoxedLongs(Long... values)
public static ColumnVector timestampsFromBoxedLongs(TimeUnit tsTimeUnit, Long... values)
public static ColumnVector fromScalar(Scalar scalar, int rows)
scalar - - Scalar to use to fill rowsrows - - Number of rows in the new ColumnVectorpublic static ColumnVector concatenate(ColumnVector... columns)
public Scalar exactQuantile(QuantileMethod method, double quantile)
method - the method used to calculate the quantilequantile - the quantile value [0,1]public Scalar approxQuantile(double quantile)
quantile - the quantile value [0,1]Copyright © 2019. All rights reserved.