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.
|
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,
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,
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.
|
ColumnVector |
exp()
Calculate the exp, output is the same type as input.
|
ColumnVector |
filter(ColumnVector mask)
Filters a column using a column of boolean values as a mask.
|
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 |
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.
|
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.
|
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.
|
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 |
incRefCount()
Increment the reference count for this column.
|
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 |
not()
Returns a vector of the logical `not` of each value in the input
column (this)
|
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 |
reduction(ReductionOp op)
Computes the reduction of the values in all rows of a column.
|
Scalar |
reduction(ReductionOp op,
DType outType)
Computes the reduction of the values in all rows of a column.
|
ColumnVector |
second()
Get second from DATE64 or TIMESTAMP
|
ColumnVector |
sin()
Calculate the sin, output is the same type as input.
|
ColumnVector |
sqrt()
Calculate the sqrt, output is the same type as input.
|
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 close()
close in interface AutoCloseablepublic ColumnVector incRefCount()
public long getRowCount()
public DType getType()
getType in interface BinaryOperablepublic long getNullCount()
public boolean hasValidityVector()
public boolean hasNulls()
public TimeUnit getTimeUnit()
public final void ensureOnDevice()
public final void ensureOnHost()
public boolean isNull(long index)
public 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 filter(ColumnVector mask)
Given an input column and a mask column, an element `i` from the input column is copied to the output if the corresponding element `i` in the mask is non-null and `true`. This operation is stable: the input order is preserved.
The input and mask columns must be of equal size.
The output column has size equal to the number of elements in boolean_mask that are both non-null and `true`.
If the input size is zero, there is no error, and an empty column is returned.
mask - column of type DType.BOOL8 used as a mask to filter
the input columnpublic 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 reduction(ReductionOp op)
op - The reduction operation to performScalar.isValid() method of the result will return false.public Scalar reduction(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 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 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 concatenate(ColumnVector... columns)
Copyright © 2019. All rights reserved.