HostColumnVector#

public final class HostColumnVector extends HostColumnVectorCore#

Similar to a ColumnVector, but the data is stored in host memory and accessible directly from the JVM.

This class holds references to off heap memory and is reference counted to know when to release it. Call close to decrement the reference count when you are done with the column, and call incRefCount to increment the reference count.

Constructor Summary

Method Summary

boolFromBytes(byte... values)

Create a new vector from the given values.

build(DType type, int rows, Consumer<Builder> init)

Create a new vector.

build(int rows, long stringBufferSize, Consumer<Builder> init)

builder(DType type, int rows)

Create a new Builder to hold the specified number of rows.

builder(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.

close()

Close this Vector and free memory allocated for HostMemoryBuffer and DeviceMemoryBuffer.

copyToDevice()

Copy the data to the device.

daysFromInts(int... values)

Create a new vector from the given values.

decimalFromBigIntegers(int scale, BigInteger... values)

Create a new decimal vector from unscaled values (BigInteger array) and scale.

decimalFromBoxedInts(int scale, Integer... values)

Create a new decimal vector from boxed unscaled values (Integer array) and scale.

decimalFromBoxedLongs(int scale, Long... values)

Create a new decimal vector from boxed unscaled values (Long array) and scale.

decimalFromDoubles(DType type, RoundingMode mode, double... values)

Create a new decimal vector from double floats with specific DecimalType and RoundingMode.

decimalFromInts(int scale, int... values)

Create a new decimal vector from unscaled values (int array) and scale.

decimalFromLongs(int scale, long... values)

Create a new decimal vector from unscaled values (long array) and scale.

durationDaysFromBoxedInts(Integer... values)

Create a new vector from the given values.

durationDaysFromInts(int... values)

Create a new vector from the given values.

durationMicrosecondsFromBoxedLongs(Long... values)

Create a new vector from the given values.

durationMicrosecondsFromLongs(long... values)

Create a new vector from the given values.

durationMillisecondsFromBoxedLongs(Long... values)

Create a new vector from the given values.

durationMillisecondsFromLongs(long... values)

Create a new vector from the given values.

durationNanosecondsFromBoxedLongs(Long... values)

Create a new vector from the given values.

durationNanosecondsFromLongs(long... values)

Create a new vector from the given values.

durationSecondsFromBoxedLongs(Long... values)

Create a new vector from the given values.

durationSecondsFromLongs(long... values)

Create a new vector from the given values.

emptyStructs(DataType dataType, long rows)

fromBoxedBooleans(Boolean... values)

Create a new vector from the given values.

fromBoxedBytes(Byte... values)

Create a new vector from the given values.

fromBoxedDoubles(Double... values)

Create a new vector from the given values.

fromBoxedFloats(Float... values)

Create a new vector from the given values.

fromBoxedInts(Integer... values)

Create a new vector from the given values.

fromBoxedLongs(Long... values)

Create a new vector from the given values.

fromBoxedShorts(Short... values)

Create a new vector from the given values.

fromBoxedUnsignedBytes(Byte... values)

Create a new vector from the given values.

fromBoxedUnsignedInts(Integer... values)

Create a new vector from the given values.

fromBoxedUnsignedLongs(Long... values)

Create a new vector from the given values.

fromBoxedUnsignedShorts(Short... values)

Create a new vector from the given values.

fromBytes(byte... values)

Create a new vector from the given values.

fromDecimals(BigDecimal... values)

Create a new vector from the given values.

fromDoubles(double... values)

Create a new vector from the given values.

fromFloats(float... values)

Create a new vector from the given values.

fromInts(int... values)

Create a new vector from the given values.

fromLists(DataType dataType, List<T>... values)

fromLongs(long... values)

Create a new vector from the given values.

fromShorts(short... values)

Create a new vector from the given values.

fromStrings(String... values)

Create a new string vector from the given values.

fromStructs(DataType dataType, List<StructData> values)

fromStructs(DataType dataType, StructData... values)

fromUnsignedBytes(byte... values)

Create a new vector from the given values.

fromUnsignedInts(int... values)

Create a new vector from the given values.

fromUnsignedLongs(long... values)

Create a new vector from the given values.

fromUnsignedShorts(short... values)

Create a new vector from the given values.

fromUTF8Strings(byte[]... values)

Create a new string vector from the given values.

getEventHandler()

Returns the current event handler for this HostColumnVector or null if no handler is associated.

getRefCount()

Returns this column’s current refcount.

incRefCount()

Increment the reference count for this column.

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.

setEventHandler(EventHandler newHandler)

Set an event handler for this host vector.

timestampDaysFromBoxedInts(Integer... values)

Create a new vector from the given values.

timestampMicroSecondsFromBoxedLongs(Long... values)

Create a new vector from the given values.

timestampMicroSecondsFromLongs(long... values)

Create a new vector from the given values.

timestampMilliSecondsFromBoxedLongs(Long... values)

Create a new vector from the given values.

timestampMilliSecondsFromLongs(long... values)

Create a new vector from the given values.

timestampNanoSecondsFromBoxedLongs(Long... values)

Create a new vector from the given values.

timestampNanoSecondsFromLongs(long... values)

Create a new vector from the given values.

timestampSecondsFromBoxedLongs(Long... values)

Create a new vector from the given values.

timestampSecondsFromLongs(long... values)

Create a new vector from the given values.

toString()

Fields inherited from class ai.rapids.cudf.HostColumnVectorCore: children, nullCount, offHeap, rows, type

Methods inherited from class ai.rapids.cudf.HostColumnVectorCore: convertDecimal128FromJavaToCudf, getBigDecimal, getBoolean, getByte, getBytesFromList, getChildColumnView, getData, getDouble, getEndListOffset, getFloat, getHostBufferFor, getHostMemorySize, getInt, getJavaString, getList, getLong, getNullCount, getNumChildren, getOffsets, getRowCount, getShort, getStartListOffset, getStruct, getType, getUTF8, getValidity, hasNulls, hasValidityVector, isNull

Constructors

public HostColumnVector(
DType type,
long rows,
Optional<Long> nullCount,
HostMemoryBuffer hostDataBuffer,
HostMemoryBuffer hostValidityBuffer
)#

Create a new non-nested, fixed-width column vector with data populated on the host.

Convenience form of HostColumnVector(DType, long, Optional, HostMemoryBuffer, HostMemoryBuffer, HostMemoryBuffer) for types that do not use an offsets buffer (i.e. all types except STRING).

NOTE: Buffers may still be receiving asynchronous device writes. This constructor only stores references; callers must sync the relevant CUDA stream before reading.

Parameters:
  • type – the type of the vector; must not be LIST, and must not be STRING unless rows count is 0

  • rows – the number of rows in the vector

  • nullCount – the number of nulls in the vector

  • hostDataBuffer – the host side data for the vector

  • hostValidityBuffer – Arrow-like validity buffer, 1 bit per row with padding for 64-bit alignment; may be null if nullCount is 0

Throws:
public HostColumnVector(
DType type,
long rows,
Optional<Long> nullCount,
HostMemoryBuffer hostDataBuffer,
HostMemoryBuffer hostValidityBuffer,
HostMemoryBuffer offsetBuffer,
List<HostColumnVectorCore> nestedHcv
)#

Create a new column vector with data populated on the host.

Parameters:
  • type – the type of the vector

  • rows – the number of rows in the vector.

  • nullCount – the number of nulls in the vector.

  • hostDataBuffer – The host side data for the vector. In the case of STRING this is the string data stored as bytes.

  • hostValidityBuffer – Arrow-like validity buffer 1 bit per row, with padding for 64-bit alignment.

  • offsetBuffer – only valid for STRING this is the offsets into the hostDataBuffer indicating the start and end of a string entry. It should be (rows + 1) ints.

  • nestedHcv – list of child HostColumnVectorCore(s) for complex types

public HostColumnVector(
DType type,
long rows,
Optional<Long> nullCount,
HostMemoryBuffer hostDataBuffer,
HostMemoryBuffer hostValidityBuffer,
HostMemoryBuffer offsetBuffer
)#

Create a new non-nested column vector with data populated on the host.

Supports fixed-width types and STRING. For LIST or STRUCT types use HostColumnVector(DType, long, Optional, HostMemoryBuffer, HostMemoryBuffer, HostMemoryBuffer, List).

NOTE: Buffers may still be receiving asynchronous device writes. This constructor only stores references; callers must sync the relevant CUDA stream before reading.

Parameters:
  • type – the type of the vector; must not be LIST

  • rows – the number of rows in the vector

  • nullCount – the number of nulls in the vector

  • hostDataBuffer – the host side data for the vector; for STRING this is the string data stored as bytes

  • hostValidityBuffer – Arrow-like validity buffer, 1 bit per row with padding for 64-bit alignment; may be null if nullCount is 0

  • offsetBuffer – for STRING, the offsets into hostDataBuffer indicating the start and end of each entry, must be (rows + 1) ints; may be null when rows count is 0; must be null for all other non-LIST types

Throws:
  • IllegalArgumentException – if type is LIST; if offsetBuffer is null for a STRING column with rows > 0; or if offsetBuffer is non-null for a non-STRING type

  • IllegalStateException – if nullCount is greater than 0 but hostValidityBuffer is null

Methods

public EventHandler setEventHandler(EventHandler newHandler)#

Set an event handler for this host vector.

This method can be invoked with null to unset the handler.

Parameters:

newHandler – - the EventHandler to use from this point forward

Returns:

the prior event handler, or null if not set.

public EventHandler getEventHandler()#

Returns the current event handler for this HostColumnVector or null if no handler is associated.

public 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.

This API informs the leak tracking code that this is expected for this column, and big scary warnings should not be printed when this happens.

public void close()#

Close this Vector and free memory allocated for HostMemoryBuffer and DeviceMemoryBuffer.

public String toString()#
public HostColumnVector incRefCount()#

Increment the reference count for this column.

You need to call close on this to decrement the reference count again.

public int getRefCount()#

Returns this column’s current refcount.

public ColumnVector copyToDevice()#

Copy the data to the device.

public static<T> HostColumnVector fromLists(
DataType dataType,
List<T>... values
)#

Static Methods

public static Builder builder(DType type, int rows)#

Create a new Builder to hold the specified number of rows.

Be sure to close the builder when done with it. Please try to use {

See also

#build(int, Consumer)} instead to avoid needing to close the builder.

Parameters:
  • type – the type of vector to build.

  • rows – the number of rows this builder can hold

Returns:

the builder to use.

public static Builder builder(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.

Be sure to close the builder when done with it. Please try to use {

See also

#build(int, int, Consumer)} instead to avoid needing to close the builder.

Parameters:
  • rows – the number of rows this builder can hold

  • stringBufferSize – the size of the string buffer to allocate.

Returns:

the builder to use.

public static HostColumnVector build(
DType type,
int rows,
Consumer<Builder> init
)#

Create a new vector.

Parameters:
  • type – the type of vector to build.

  • rows – maximum number of rows that the vector can hold.

  • init – what will initialize the vector.

Returns:

the created vector.

public static HostColumnVector build(
int rows,
long stringBufferSize,
Consumer<Builder> init
)#
public static HostColumnVector fromStructs(
DataType dataType,
List<StructData> values
)#
public static HostColumnVector fromStructs(
DataType dataType,
StructData... values
)#
public static HostColumnVector emptyStructs(
DataType dataType,
long rows
)#
public static HostColumnVector boolFromBytes(byte... values)#

Create a new vector from the given values.

public static HostColumnVector fromBytes(byte... values)#

Create a new vector from the given values.

public static HostColumnVector fromUnsignedBytes(byte... values)#

Create a new vector from the given values.

Java does not have an unsigned byte type, so the values will be treated as if the bits represent an unsigned value.

public static HostColumnVector fromShorts(short... values)#

Create a new vector from the given values.

public static HostColumnVector fromUnsignedShorts(short... values)#

Create a new vector from the given values.

Java does not have an unsigned short type, so the values will be treated as if the bits represent an unsigned value.

public static HostColumnVector durationNanosecondsFromLongs(
long... values
)#

Create a new vector from the given values.

public static HostColumnVector durationMicrosecondsFromLongs(
long... values
)#

Create a new vector from the given values.

public static HostColumnVector durationMillisecondsFromLongs(
long... values
)#

Create a new vector from the given values.

public static HostColumnVector durationSecondsFromLongs(
long... values
)#

Create a new vector from the given values.

public static HostColumnVector durationDaysFromInts(int... values)#

Create a new vector from the given values.

public static HostColumnVector fromInts(int... values)#

Create a new vector from the given values.

public static HostColumnVector fromUnsignedInts(int... values)#

Create a new vector from the given values.

Java does not have an unsigned int type, so the values will be treated as if the bits represent an unsigned value.

public static HostColumnVector fromLongs(long... values)#

Create a new vector from the given values.

public static HostColumnVector fromUnsignedLongs(long... values)#

Create a new vector from the given values.

Java does not have an unsigned long type, so the values will be treated as if the bits represent an unsigned value.

public static HostColumnVector fromFloats(float... values)#

Create a new vector from the given values.

public static HostColumnVector fromDoubles(double... values)#

Create a new vector from the given values.

public static HostColumnVector daysFromInts(int... values)#

Create a new vector from the given values.

public static HostColumnVector timestampSecondsFromLongs(
long... values
)#

Create a new vector from the given values.

public static HostColumnVector timestampMilliSecondsFromLongs(
long... values
)#

Create a new vector from the given values.

public static HostColumnVector timestampMicroSecondsFromLongs(
long... values
)#

Create a new vector from the given values.

public static HostColumnVector timestampNanoSecondsFromLongs(
long... values
)#

Create a new vector from the given values.

public static HostColumnVector decimalFromInts(
int scale,
int... values
)#

Create a new decimal vector from unscaled values (int array) and scale.

The created vector is of type DType.DECIMAL32, whose max precision is 9. Compared with scale of java.math.BigDecimal, the scale here represents the opposite meaning.

public static HostColumnVector decimalFromBoxedInts(
int scale,
Integer... values
)#

Create a new decimal vector from boxed unscaled values (Integer array) and scale.

The created vector is of type DType.DECIMAL32, whose max precision is 9. Compared with scale of java.math.BigDecimal, the scale here represents the opposite meaning.

public static HostColumnVector decimalFromLongs(
int scale,
long... values
)#

Create a new decimal vector from unscaled values (long array) and scale.

The created vector is of type DType.DECIMAL64, whose max precision is 18. Compared with scale of java.math.BigDecimal, the scale here represents the opposite meaning.

public static HostColumnVector decimalFromBoxedLongs(
int scale,
Long... values
)#

Create a new decimal vector from boxed unscaled values (Long array) and scale.

The created vector is of type DType.DECIMAL64, whose max precision is 18. Compared with scale of java.math.BigDecimal, the scale here represents the opposite meaning.

public static HostColumnVector decimalFromBigIntegers(
int scale,
BigInteger... values
)#

Create a new decimal vector from unscaled values (BigInteger array) and scale.

The created vector is of type DType.DECIMAL128. Compared with scale of java.math.BigDecimal, the scale here represents the opposite meaning.

public static HostColumnVector decimalFromDoubles(
DType type,
RoundingMode mode,
double... values
)#

Create a new decimal vector from double floats with specific DecimalType and RoundingMode.

All doubles will be rescaled if necessary, according to scale of input DecimalType and RoundingMode. If any overflow occurs in extracting integral part, an IllegalArgumentException will be thrown. This API is inefficient because of slow double -> decimal conversion, so it is mainly for testing. Compared with scale of java.math.BigDecimal, the scale here represents the opposite meaning.

public static HostColumnVector fromStrings(String... values)#

Create a new string vector from the given values.

This API supports inline nulls. This is really intended to be used only for testing as it is slow and memory intensive to translate between java strings and UTF8 strings.

public static HostColumnVector fromUTF8Strings(byte[]... values)#

Create a new string vector from the given values.

This API supports inline nulls.

public static HostColumnVector fromDecimals(BigDecimal... values)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than building from primitive array of unscaledValues. Notice:

  1. Input values will be rescaled with min scale (max scale in terms of java.math.BigDecimal), which avoids potential precision loss due to rounding. But there exists risk of precision overflow.

  2. The scale will be zero if all input values are null.

public static HostColumnVector fromBoxedBooleans(Boolean... values)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector fromBoxedBytes(Byte... values)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector fromBoxedUnsignedBytes(Byte... values)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

Java does not have an unsigned byte type, so the values will be treated as if the bits represent an unsigned value.

public static HostColumnVector fromBoxedShorts(Short... values)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector fromBoxedUnsignedShorts(
Short... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

Java does not have an unsigned short type, so the values will be treated as if the bits represent an unsigned value.

public static HostColumnVector durationNanosecondsFromBoxedLongs(
Long... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector durationMicrosecondsFromBoxedLongs(
Long... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector durationMillisecondsFromBoxedLongs(
Long... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector durationSecondsFromBoxedLongs(
Long... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector durationDaysFromBoxedInts(
Integer... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector fromBoxedInts(Integer... values)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector fromBoxedUnsignedInts(
Integer... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

Java does not have an unsigned int type, so the values will be treated as if the bits represent an unsigned value.

public static HostColumnVector fromBoxedLongs(Long... values)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector fromBoxedUnsignedLongs(Long... values)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

Java does not have an unsigned long type, so the values will be treated as if the bits represent an unsigned value.

public static HostColumnVector fromBoxedFloats(Float... values)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector fromBoxedDoubles(Double... values)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector timestampDaysFromBoxedInts(
Integer... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector timestampSecondsFromBoxedLongs(
Long... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector timestampMilliSecondsFromBoxedLongs(
Long... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector timestampMicroSecondsFromBoxedLongs(
Long... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public static HostColumnVector timestampNanoSecondsFromBoxedLongs(
Long... values
)#

Create a new vector from the given values.

This API supports inline nulls, but is much slower than using a regular array and should really only be used for tests.

public interface EventHandler#

Interface to handle events for this HostColumnVector.

Only invoked during close, hence onClosed is the only event.

Method Summary

onClosed(HostColumnVector cv, int refCount)

onClosed is invoked with the updated refCount during close.

Methods

public void onClosed(HostColumnVector cv, int refCount)#

onClosed is invoked with the updated refCount during close.

The last invocation of onClosed will be with refCount=0.

Note

the callback is invoked with this HostColumnVector’s lock held.

Parameters:
public static final class ColumnBuilder implements AutoCloseable#

Build.

Constructor Summary

Method Summary

append(BigDecimal value)

append(BigInteger unscaledVal)

append(String value)

append(boolean value)

append(byte value)

append(byte[] value, int srcOffset, int length)

Append multiple non-null byte values.

append(double value)

append(float value)

append(int value)

append(long value)

append(short value)

appendByteList(byte[] value)

Appends byte to a LIST of INT8/UINT8.

appendByteList(byte[] value, int srcOffset, int length)

Appends bytes to a LIST of INT8/UINT8.

appendDecimal128(byte[] binary)

Accepts a byte array containing the two’s-complement representation of the unscaled value, which is in big-endian byte-order.

appendLists(List... inputLists)

appendNull()

appendStructValues(List<StructData> inputList)

appendStructValues(StructData... inputList)

appendUTF8String(byte[] value)

appendUTF8String(byte[] value, int srcOffset, int length)

build()

buildAndPutOnDevice()

Finish and create the immutable ColumnVector, copied to the device.

close()

endList()

If you want to build up a list column you can get builder.getChild(0) and append to than, then when you are done call endList and everything that was appended to that builder will now be in the next list.

endStruct()

If you want to build up a struct column you can get each child builder.getChild(N) and append to all of them, then when you are done call endStruct to update this builder.

getChild(int index)

getCurrentByteIndex()

Deprecated.

getCurrentIndex()

incrCurrentIndex()

Deprecated.

toString()

Constructors

public ColumnBuilder(
HostColumnVector.DataType type,
long estimatedRows
)#

Methods

public HostColumnVector build()#
public ColumnBuilder appendLists(List... inputLists)#
public ColumnBuilder appendStructValues(List<StructData> inputList)#
public ColumnBuilder appendStructValues(StructData... inputList)#
public final ColumnBuilder appendNull()#
public ColumnBuilder endStruct()#

If you want to build up a struct column you can get each child builder.getChild(N) and append to all of them, then when you are done call endStruct to update this builder.

Do not start to append to the child and then append a null to this without ending the struct first or you might not get the results that you expected.

Returns:

this for chaining.

public ColumnBuilder endList()#

If you want to build up a list column you can get builder.getChild(0) and append to than, then when you are done call endList and everything that was appended to that builder will now be in the next list.

Do not start to append to the child and then append a null to this without ending the list first or you might not get the results that you expected.

Returns:

this for chaining.

public void incrCurrentIndex() Deprecated#
public int getCurrentIndex()#
public int getCurrentByteIndex() Deprecated#
public final ColumnBuilder append(byte value)#
public final ColumnBuilder append(short value)#
public final ColumnBuilder append(int value)#
public final ColumnBuilder append(long value)#
public final ColumnBuilder append(float value)#
public final ColumnBuilder append(double value)#
public final ColumnBuilder append(boolean value)#
public ColumnBuilder append(BigDecimal value)#
public ColumnBuilder append(BigInteger unscaledVal)#
public ColumnBuilder append(String value)#
public ColumnBuilder appendUTF8String(byte[] value)#
public ColumnBuilder appendUTF8String(
byte[] value,
int srcOffset,
int length
)#
public ColumnBuilder append(byte[] value, int srcOffset, int length)#

Append multiple non-null byte values.

public ColumnBuilder appendByteList(byte[] value)#

Appends byte to a LIST of INT8/UINT8.

public ColumnBuilder appendByteList(
byte[] value,
int srcOffset,
int length
)#

Appends bytes to a LIST of INT8/UINT8.

public ColumnBuilder appendDecimal128(byte[] binary)#

Accepts a byte array containing the two’s-complement representation of the unscaled value, which is in big-endian byte-order.

Then, transforms it into the representation of cuDF Decimal128 for appending. This method is more efficient than append(BigInteger unscaledVal) if we can directly access the two’s-complement representation of a BigDecimal without encoding via the method toByteArray.

public ColumnBuilder getChild(int index)#
public final ColumnVector buildAndPutOnDevice()#

Finish and create the immutable ColumnVector, copied to the device.

public void close()#
public String toString()#
public static final class Builder implements AutoCloseable#

Method Summary

append(BigDecimal value)

Append java.math.BigDecimal into HostColumnVector with UNNECESSARY RoundingMode.

append(BigDecimal value, RoundingMode roundingMode)

Append java.math.BigDecimal into HostColumnVector with user-defined RoundingMode.

append(HostColumnVector columnVector)

Append this vector to the end of this vector.

append(String value)

append(boolean value)

append(byte value)

append(byte value, long count)

append(double value)

append(float value)

append(int value)

append(long value)

append(short value)

appendArray(byte... values)

appendArray(double... values)

appendArray(float... values)

appendArray(int... values)

appendArray(long... values)

appendArray(short... values)

appendBoxed(BigDecimal... values)

Append multiple values.

appendBoxed(Boolean... values)

Append multiple values.

appendBoxed(Byte... values)

Append multiple values.

appendBoxed(Double... values)

Append multiple values.

appendBoxed(Float... values)

Append multiple values.

appendBoxed(Integer... values)

Append multiple values.

appendBoxed(Long... values)

Append multiple values.

appendBoxed(Short... values)

Append multiple values.

appendBoxed(String... values)

Append multiple values.

appendNull()

Append null value.

appendUnscaledDecimal(BigInteger value)

appendUnscaledDecimal(int value)

appendUnscaledDecimal(long value)

appendUnscaledDecimalArray(int... values)

appendUnscaledDecimalArray(long... values)

appendUTF8String(byte[] value)

appendUTF8String(byte[] value, int offset, int length)

build()

Finish and create the immutable CudfColumn.

buildAndPutOnDevice()

Finish and create the immutable ColumnVector, copied to the device.

close()

Close this builder and free memory if the CudfColumn wasn’t generated.

setNullAt(long index)

Set a specific index to null.

toString()

Methods

public final Builder append(boolean value)#
public final Builder append(byte value)#
public final Builder append(byte value, long count)#
public final Builder append(short value)#
public final Builder append(int value)#
public final Builder append(long value)#
public final Builder append(float value)#
public final Builder append(double value)#
public final Builder append(BigDecimal value)#

Append java.math.BigDecimal into HostColumnVector with UNNECESSARY RoundingMode.

Input decimal should have a larger scale than column vector.Otherwise, an ArithmeticException will be thrown while rescaling. If unscaledValue after rescaling exceeds the max precision of rapids type, an ArithmeticException will be thrown while extracting integral.

Parameters:

value – BigDecimal value to be appended

public final Builder append(
BigDecimal value,
RoundingMode roundingMode
)#

Append java.math.BigDecimal into HostColumnVector with user-defined RoundingMode.

Input decimal will be rescaled according to scale of column type and RoundingMode before appended. If unscaledValue after rescaling exceeds the max precision of rapids type, an ArithmeticException will be thrown.

Parameters:
  • value – BigDecimal value to be appended

  • roundingMode – rounding mode determines rescaling behavior

public final Builder appendUnscaledDecimal(int value)#
public final Builder appendUnscaledDecimal(long value)#
public final Builder appendUnscaledDecimal(BigInteger value)#
public Builder append(String value)#
public Builder appendUTF8String(byte[] value)#
public Builder appendUTF8String(byte[] value, int offset, int length)#
public Builder appendArray(byte... values)#
public Builder appendArray(short... values)#
public Builder appendArray(int... values)#
public Builder appendArray(long... values)#
public Builder appendArray(float... values)#
public Builder appendArray(double... values)#
public Builder appendUnscaledDecimalArray(int... values)#
public Builder appendUnscaledDecimalArray(long... values)#
public Builder appendBoxed(
BigDecimal... values
) throws IndexOutOfBoundsException#

Append multiple values.

This is very slow and should really only be used for tests.

Parameters:

values – the values to append, including nulls.

Throws:

IndexOutOfBoundsException –

Returns:

this for chaining.

public final Builder appendBoxed(
Byte... values
) throws IndexOutOfBoundsException#

Append multiple values.

This is very slow and should really only be used for tests.

Parameters:

values – the values to append, including nulls.

Throws:

IndexOutOfBoundsException –

Returns:

this for chaining.

public final Builder appendBoxed(
Boolean... values
) throws IndexOutOfBoundsException#

Append multiple values.

This is very slow and should really only be used for tests.

Parameters:

values – the values to append, including nulls.

Throws:

IndexOutOfBoundsException –

Returns:

this for chaining.

public final Builder appendBoxed(
Short... values
) throws IndexOutOfBoundsException#

Append multiple values.

This is very slow and should really only be used for tests.

Parameters:

values – the values to append, including nulls.

Throws:

IndexOutOfBoundsException –

Returns:

this for chaining.

public final Builder appendBoxed(
Integer... values
) throws IndexOutOfBoundsException#

Append multiple values.

This is very slow and should really only be used for tests.

Parameters:

values – the values to append, including nulls.

Throws:

IndexOutOfBoundsException –

Returns:

this for chaining.

public final Builder appendBoxed(
Long... values
) throws IndexOutOfBoundsException#

Append multiple values.

This is very slow and should really only be used for tests.

Parameters:

values – the values to append, including nulls.

Throws:

IndexOutOfBoundsException –

Returns:

this for chaining.

public final Builder appendBoxed(
Float... values
) throws IndexOutOfBoundsException#

Append multiple values.

This is very slow and should really only be used for tests.

Parameters:

values – the values to append, including nulls.

Throws:

IndexOutOfBoundsException –

Returns:

this for chaining.

public final Builder appendBoxed(
Double... values
) throws IndexOutOfBoundsException#

Append multiple values.

This is very slow and should really only be used for tests.

Parameters:

values – the values to append, including nulls.

Throws:

IndexOutOfBoundsException –

Returns:

this for chaining.

public final Builder appendBoxed(
String... values
) throws IndexOutOfBoundsException#

Append multiple values.

This is very slow and should really only be used for tests.

Parameters:

values – the values to append, including nulls.

Throws:

IndexOutOfBoundsException –

Returns:

this for chaining.

public final Builder append(HostColumnVector columnVector)#

Append this vector to the end of this vector.

Parameters:

columnVector – - Vector to be added

Returns:

- The CudfColumn based on this builder values

public final Builder appendNull()#

Append null value.

public final Builder setNullAt(long index)#

Set a specific index to null.

Parameters:

index –

public final HostColumnVector build()#

Finish and create the immutable CudfColumn.

public final ColumnVector buildAndPutOnDevice()#

Finish and create the immutable ColumnVector, copied to the device.

public final void close()#

Close this builder and free memory if the CudfColumn wasn’t generated.

Verifies that the data was released even in the case of an error.

public String toString()#
public static abstract class DataType#

Subclassed by ai.rapids.cudf.HostColumnVector.BasicType, ai.rapids.cudf.HostColumnVector.ListType, ai.rapids.cudf.HostColumnVector.StructType

Method Summary

Methods

public abstract DType getType()#
public abstract boolean isNullable()#
public abstract DataType getChild(int index)#
public abstract int getNumChildren()#
public static class ListType extends HostColumnVector.DataType#

Constructor Summary

Method Summary

Constructors

public ListType(boolean isNullable, DataType child)#

Methods

public DType getType()#
public boolean isNullable()#
public HostColumnVector.DataType getChild(int index)#
public int getNumChildren()#
public static class StructData#

Constructor Summary

Method Summary

Constructors

public StructData(List<Object> dataRecord)#
public StructData(Object... data)#

Methods

public int getNumFields()#
public boolean isNull()#
public Object getField(int index)#
public static class StructType extends HostColumnVector.DataType#

Constructor Summary

Method Summary

Constructors

public StructType(
boolean isNullable,
List<HostColumnVector.DataType> children
)#
public StructType(boolean isNullable, DataType... children)#

Methods

public DType getType()#
public boolean isNullable()#
public HostColumnVector.DataType getChild(int index)#
public int getNumChildren()#
public static class BasicType extends HostColumnVector.DataType#

Constructor Summary

Method Summary

Constructors

public BasicType(boolean isNullable, DType type)#

Methods

public DType getType()#
public boolean isNullable()#
public HostColumnVector.DataType getChild(int index)#
public int getNumChildren()#