public final class Scalar extends Object implements AutoCloseable, BinaryOperable
Modifier and Type | Method and Description |
---|---|
ColumnVector |
binaryOp(BinaryOp op,
BinaryOperable rhs,
DType outType)
Multiple different binary operations.
|
void |
close()
Free the memory associated with a scalar.
|
static Scalar |
durationDaysFromInt(int value)
Returns a DURATION_DAYS scalar
|
static Scalar |
durationDaysFromInt(Integer value)
Returns a DURATION_DAYS scalar
|
static Scalar |
durationFromLong(DType type,
long value)
Returns a duration scalar based on the type parameter.
|
static Scalar |
durationFromLong(DType type,
Long value)
Returns a duration scalar based on the type parameter.
|
boolean |
equals(Object o) |
static Scalar |
fromBool(boolean value) |
static Scalar |
fromBool(Boolean value) |
static Scalar |
fromByte(byte value) |
static Scalar |
fromByte(Byte value) |
static Scalar |
fromDecimal(BigDecimal value) |
static Scalar |
fromDecimal(BigInteger unscaledValue,
DType dt) |
static Scalar |
fromDecimal(int scale,
BigInteger unscaledValue) |
static Scalar |
fromDecimal(int scale,
int unscaledValue) |
static Scalar |
fromDecimal(int scale,
long unscaledValue) |
static Scalar |
fromDouble(double value) |
static Scalar |
fromDouble(Double value) |
static Scalar |
fromFloat(float value) |
static Scalar |
fromFloat(Float value) |
static Scalar |
fromInt(int value) |
static Scalar |
fromInt(Integer value) |
static Scalar |
fromLong(long value) |
static Scalar |
fromLong(Long value) |
static Scalar |
fromNull(DType type) |
static Scalar |
fromShort(short value) |
static Scalar |
fromShort(Short value) |
static Scalar |
fromString(String value) |
static Scalar |
fromUnsignedByte(byte value) |
static Scalar |
fromUnsignedByte(Byte value) |
static Scalar |
fromUnsignedInt(int value) |
static Scalar |
fromUnsignedInt(Integer value) |
static Scalar |
fromUnsignedLong(long value) |
static Scalar |
fromUnsignedLong(Long value) |
static Scalar |
fromUnsignedShort(short value) |
static Scalar |
fromUnsignedShort(Short value) |
static Scalar |
fromUTF8String(byte[] value)
Creates a String scalar from an array of UTF8 bytes.
|
BigDecimal |
getBigDecimal()
Returns the scalar value as a BigDecimal.
|
byte[] |
getBigInteger()
Returns the BigDecimal unscaled scalar value as a byte array.
|
boolean |
getBoolean()
Returns the scalar value as a boolean.
|
byte |
getByte()
Returns the scalar value as a byte.
|
ColumnView[] |
getChildrenFromStructScalar()
Fetches views of children columns from struct scalar.
|
double |
getDouble()
Returns the scalar value as a double.
|
float |
getFloat()
Returns the scalar value as a float.
|
int |
getInt()
Returns the scalar value as an int.
|
String |
getJavaString()
Returns the scalar value as a Java string.
|
ColumnView |
getListAsColumnView()
Returns the scalar value as a ColumnView.
|
long |
getLong()
Returns the scalar value as a long.
|
short |
getShort()
Returns the scalar value as a short.
|
DType |
getType()
Get the type of this data.
|
byte[] |
getUTF8()
Returns the scalar value as UTF-8 data.
|
int |
hashCode() |
Scalar |
incRefCount()
Increment the reference count for this scalar.
|
boolean |
isValid() |
static Scalar |
listFromColumnView(ColumnView list)
Creates a scalar of list from a ColumnView.
|
static Scalar |
listFromNull(HostColumnVector.DataType elementType)
Creates a null scalar of list type.
|
Scalar |
repeatString(int repeatTimes)
Repeat the given string scalar a number of times specified by the
repeatTimes
parameter. |
static Scalar |
structFromColumnViews(ColumnView... columns)
Creates a scalar of struct from a ColumnView.
|
static Scalar |
structFromNull(HostColumnVector.DataType... elementTypes)
Creates a null scalar of struct type.
|
static Scalar |
timestampDaysFromInt(int value) |
static Scalar |
timestampDaysFromInt(Integer value) |
static Scalar |
timestampFromLong(DType type,
long value) |
static Scalar |
timestampFromLong(DType type,
Long value) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, add, and, and, arctan2, arctan2, bitAnd, bitAnd, bitOr, bitOr, bitXor, bitXor, div, div, equalTo, equalTo, equalToNullAware, equalToNullAware, floorDiv, floorDiv, greaterOrEqualTo, greaterOrEqualTo, greaterThan, greaterThan, implicitConversion, lessOrEqualTo, lessOrEqualTo, lessThan, lessThan, log, log, maxNullAware, maxNullAware, minNullAware, minNullAware, mod, mod, mul, mul, notEqualTo, notEqualTo, notEqualToNullAware, notEqualToNullAware, or, or, pmod, pmod, pow, pow, shiftLeft, shiftLeft, shiftRight, shiftRight, shiftRightUnsigned, shiftRightUnsigned, sub, sub, trueDiv, trueDiv
public static Scalar fromBool(boolean value)
public static Scalar fromByte(byte value)
public static Scalar fromUnsignedByte(byte value)
public static Scalar fromShort(short value)
public static Scalar fromUnsignedShort(short value)
public static Scalar durationDaysFromInt(int value)
value
- - dayspublic static Scalar durationDaysFromInt(Integer value)
value
- - dayspublic static Scalar fromInt(int value)
public static Scalar fromUnsignedInt(int value)
public static Scalar fromLong(long value)
public static Scalar fromUnsignedLong(long value)
public static Scalar fromFloat(float value)
public static Scalar fromDecimal(int scale, int unscaledValue)
public static Scalar fromDecimal(int scale, long unscaledValue)
public static Scalar fromDecimal(int scale, BigInteger unscaledValue)
public static Scalar fromDouble(double value)
public static Scalar fromDecimal(BigDecimal value)
public static Scalar fromDecimal(BigInteger unscaledValue, DType dt)
public static Scalar timestampDaysFromInt(int value)
public static Scalar durationFromLong(DType type, long value)
type
- - dtype of scalar to be returnedvalue
- - corresponding value for the scalarpublic static Scalar durationFromLong(DType type, Long value)
type
- - dtype of scalar to be returnedvalue
- - corresponding value for the scalarpublic static Scalar fromUTF8String(byte[] value)
value
- the array of UTF8 bytespublic static Scalar listFromNull(HostColumnVector.DataType elementType)
elementType
- the data type of the element in the list.public static Scalar listFromColumnView(ColumnView list)
public static Scalar structFromNull(HostColumnVector.DataType... elementTypes)
elementTypes
- data types of children in the structpublic static Scalar structFromColumnViews(ColumnView... columns)
columns
- children columns of structpublic Scalar incRefCount()
public void close()
close
in interface AutoCloseable
public DType getType()
BinaryOperable
getType
in interface BinaryOperable
public boolean isValid()
public boolean getBoolean()
public byte getByte()
public short getShort()
public int getInt()
public long getLong()
public byte[] getBigInteger()
public float getFloat()
public double getDouble()
public BigDecimal getBigDecimal()
public String getJavaString()
public byte[] getUTF8()
public ColumnView getListAsColumnView()
public ColumnView[] getChildrenFromStructScalar()
public ColumnVector binaryOp(BinaryOp op, BinaryOperable rhs, DType outType)
BinaryOperable
binaryOp
in interface BinaryOperable
op
- the operation to performrhs
- the rhs of the operationoutType
- the type of output you want.public Scalar repeatString(int repeatTimes)
repeatTimes
parameter. If that parameter has a non-positive value, an empty (valid) string scalar will be
returned. An invalid input scalar will always result in an invalid output scalar regardless
of the value of repeatTimes
.repeatTimes
- The number of times the input string is copied to the output.Copyright © 2024. All rights reserved.