Package io.delta.kernel.internal.util
Class VectorUtils
Object
io.delta.kernel.internal.util.VectorUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayValue
buildArrayValue
(List<?> values, DataType dataType) Creates anArrayValue
from list of objects.static ColumnVector
buildColumnVector
(List<?> values, DataType dataType) Utility method to create aColumnVector
for given list of object, the object should be primitive type or an Row instance.static MapValue
stringStringMapValue
(Map<String, String> keyValues) Creates aMapValue
from map of string keys and string values.static <T> List<T>
toJavaList
(ArrayValue arrayValue) Converts anArrayValue
to a Java list.static <K,
V> Map<K, V> Converts aMapValue
to a Java map.
-
Method Details
-
toJavaList
Converts anArrayValue
to a Java list. Any nested complex types are also converted to their Java type. -
toJavaMap
Converts aMapValue
to a Java map. Any nested complex types are also converted to their Java type.Please note not all key types override hashCode/equals. Be careful when using with keys of: - Struct type at any nesting level (i.e. ArrayType(StructType) does not) - Binary type
-
stringStringMapValue
Creates aMapValue
from map of string keys and string values. The typemap(string -> string)
is a common occurrence in Delta Log schema.- Parameters:
keyValues
-- Returns:
-
buildArrayValue
Creates anArrayValue
from list of objects. -
buildColumnVector
Utility method to create aColumnVector
for given list of object, the object should be primitive type or an Row instance.- Parameters:
values
- list of strings- Returns:
- a
ColumnVector
with the given values type.
-