Interface ValueVector
- All Known Subinterfaces:
MutableValueVector
- All Known Implementing Classes:
Decimal,EpochDateTime,EpochDateTimeOffset,SelectedValueVector,UTF8String,ValueVector.LiteralValueVector
public interface ValueVector
Definition of a value vector. All values for one column in a
TupleVector batch.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBase class for literal vectors -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map<Column.Type,ValueVector> static final List<ValueVector>static final Map<Column.Type,ValueVector> static final List<ValueVector> -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueVectorempty(ResolvedType type) Constructs an emptyValueVectorwith provided typedefault ObjectgetAny(int row) Return value of provided row.default ValueVectorgetArray(int row) Return array for provided rowdefault booleangetBoolean(int row) Get boolean value for provided rowdefault intReturn the cardinality of this vector.default EpochDateTimegetDateTime(int row) Get date time at provided rowdefault EpochDateTimeOffsetgetDateTimeOffset(int row) Get date time offset at provided rowdefault DecimalgetDecimal(int row) Get decimal value for provided rowdefault doublegetDouble(int row) Get double value for provided rowdefault floatgetFloat(int row) Get float value for provided rowdefault intgetInt(int row) Get int value for provided rowdefault longgetLong(int row) Get long value for provided rowdefault ObjectVectorgetObject(int row) Return object for provided rowdefault booleangetPredicateBoolean(int row) Get predicate boolean, ie.default UTF8StringgetString(int row) Get string at provided row.default TupleVectorgetTable(int row) Return table for provided rowbooleanisNull(int row) Return if value at provided row is nullstatic ValueVectorliteralAny(int size, Object value) Create a literal vector of typeColumn.Type.Anywith provided value and sizestatic ValueVectorliteralAny(Object... values) Create a literal vector of typeColumn.Type.Anywith provided valuesstatic ValueVectorliteralArray(ValueVector value, int size) Create a literal vector of typeColumn.Type.Arraywith provided value and sizestatic ValueVectorliteralArray(ValueVector value, ResolvedType type, int size) Create a literal vector of typeColumn.Type.Arraywith provided value, type and size NOTE! This can create an array with a different type as the vector.static ValueVectorliteralBoolean(boolean value, int size) Create a literal boolean of provided value and sizestatic ValueVectorliteralDateTime(EpochDateTime value, int size) Create a literal vector of typeColumn.Type.DateTimewith provided value and sizestatic ValueVectorliteralDateTimeOffset(EpochDateTimeOffset value, int size) Create a literal vector of typeColumn.Type.DateTimeOffsetwith provided value and sizestatic ValueVectorliteralDecimal(Decimal... values) Create a literal vector of typeColumn.Type.Decimalwith provided valuesstatic ValueVectorliteralDecimal(Decimal value, int size) Create a literal vector of typeColumn.Type.Decimalwith provided value and sizestatic ValueVectorliteralDouble(double value, int size) Create a literal double of provided value and sizestatic ValueVectorliteralFloat(float value, int size) Create a literal long of provided value and sizestatic ValueVectorliteralInt(int value, int size) Create a literal int of provided value and sizestatic ValueVectorliteralLong(long value, int size) Create a literal long of provided value and sizestatic ValueVectorliteralNull(ResolvedType type, int size) Create a literal null of provided value and sizestatic ValueVectorliteralObject(ObjectVector value, int size) Create a literal vector of typeColumn.Type.Objectwith provided value and sizestatic ValueVectorliteralObject(ObjectVector value, ResolvedType type, int size) Create a literal vector of typeColumn.Type.Objectwith provided value, type and size NOTE! This can create an object with a different type as the vector.static ValueVectorliteralString(String value, int size) Create a literal string of provided value and sizestatic ValueVectorliteralString(UTF8String... values) Create a literal string of provided value and sizestatic ValueVectorliteralString(UTF8String value, int size) Create a literal string of provided value and sizestatic ValueVectorliteralTable(TupleVector... values) Create a literal vector of typeColumn.Type.Tablewith provided valuesstatic ValueVectorliteralTable(TupleVector value, int size) Create a literal vector of typeColumn.Type.Tablewith provided value and sizestatic ValueVectorliteralTable(TupleVector value, ResolvedType type, int size) Create a literal vector of typeColumn.Type.Tablewith provided value, type and size NOTE! This can create a table with a different type as the vector.static ValueVectorrange(int from, int to) Create a range vector of value between from (inclusive) and to (exclusive)intsize()Return size of vectorstatic booleantoBoolean(ResolvedType type, Object v) Cast provided value to boolean if possible else throwsdefault StringtoCsv()Return csv (tab separated) of this value vectordefault StringtoCsv(int indent) Return csv (tab separated) of this value vectorstatic doubletoDouble(ResolvedType type, Object v) Cast provided value to double if possible else throwsstatic floattoFloat(ResolvedType type, Object v) Cast provided value to float if possible else throwsstatic inttoInt(ResolvedType type, Object v) Cast provided value to int if possible else throwsstatic longtoLong(ResolvedType type, Object v) Cast provided value to long if possible else throwstype()Return type of vector valuesdefault ObjectvalueAsObject(int row) Return value as object include null value.default StringvalueAsString(int row) Return value as Java string for provided row
-
Field Details
-
ONE_SIZE_NULL_VECTOR_BY_TYPE
-
TRUE_VECTORS
-
FALSE_VECTORS
-
EMPTY_VECTOR_BY_TYPE
-
-
Method Details
-
type
ResolvedType type()Return type of vector values -
size
int size()Return size of vector -
isNull
boolean isNull(int row) Return if value at provided row is null -
getString
Get string at provided row. -
getDateTime
Get date time at provided row -
getDateTimeOffset
Get date time offset at provided row -
getBoolean
default boolean getBoolean(int row) Get boolean value for provided row -
getInt
default int getInt(int row) Get int value for provided row -
getLong
default long getLong(int row) Get long value for provided row -
getDecimal
Get decimal value for provided row -
getFloat
default float getFloat(int row) Get float value for provided row -
getDouble
default double getDouble(int row) Get double value for provided row -
getAny
Return value of provided row. NOTE! This method must not be used when checking if value is null. UseisNull(int). -
getObject
Return object for provided row -
getArray
Return array for provided row -
getTable
Return table for provided row -
valueAsObject
Return value as object include null value. Note! This method differs fromgetAny(int)in that sense that this method converts the actual value to a boxed type andgetAny(int)is the real accessor for the vectors actual type. -
valueAsString
Return value as Java string for provided row -
getPredicateBoolean
default boolean getPredicateBoolean(int row) Get predicate boolean, ie. null is false -
getCardinality
default int getCardinality()Return the cardinality of this vector. Only applicable for boolean vectors. Used for predicates -
literalObject
Create a literal vector of typeColumn.Type.Objectwith provided value and size -
literalObject
Create a literal vector of typeColumn.Type.Objectwith provided value, type and size NOTE! This can create an object with a different type as the vector. This is used when having asterisk schemas and one is the planned type and the other is the runtime type. -
literalArray
Create a literal vector of typeColumn.Type.Arraywith provided value and size -
literalArray
Create a literal vector of typeColumn.Type.Arraywith provided value, type and size NOTE! This can create an array with a different type as the vector. This is used when having asterisk schemas and one is the planned type and the other is the runtime type. -
literalTable
Create a literal vector of typeColumn.Type.Tablewith provided value and size -
literalTable
Create a literal vector of typeColumn.Type.Tablewith provided value, type and size NOTE! This can create a table with a different type as the vector. This is used when having asterisk schemas and one is the planned type and the other is the runtime type. -
literalTable
Create a literal vector of typeColumn.Type.Tablewith provided values -
literalDateTime
Create a literal vector of typeColumn.Type.DateTimewith provided value and size -
literalDateTimeOffset
Create a literal vector of typeColumn.Type.DateTimeOffsetwith provided value and size -
literalDecimal
Create a literal vector of typeColumn.Type.Decimalwith provided value and size -
literalDecimal
Create a literal vector of typeColumn.Type.Decimalwith provided values -
literalAny
Create a literal vector of typeColumn.Type.Anywith provided value and size -
literalAny
Create a literal vector of typeColumn.Type.Anywith provided values -
literalNull
Create a literal null of provided value and size -
range
Create a range vector of value between from (inclusive) and to (exclusive) -
literalInt
Create a literal int of provided value and size -
literalLong
Create a literal long of provided value and size -
literalFloat
Create a literal long of provided value and size -
literalDouble
Create a literal double of provided value and size -
literalBoolean
Create a literal boolean of provided value and size -
literalString
Create a literal string of provided value and size -
literalString
Create a literal string of provided value and size -
literalString
Create a literal string of provided value and size -
empty
Constructs an emptyValueVectorwith provided type -
toBoolean
Cast provided value to boolean if possible else throws -
toInt
Cast provided value to int if possible else throws -
toLong
Cast provided value to long if possible else throws -
toFloat
Cast provided value to float if possible else throws -
toDouble
Cast provided value to double if possible else throws -
toCsv
Return csv (tab separated) of this value vector -
toCsv
Return csv (tab separated) of this value vector
-