Package io.delta.kernel.internal.util
Class VectorUtils
Object
io.delta.kernel.internal.util.VectorUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayValuestringArrayValue(List<String> values) Creates anArrayValuefrom list of strings.static MapValuestringStringMapValue(Map<String, String> keyValues) Creates aMapValuefrom map of string keys and string values.static ColumnVectorstringVector(List<String> values) Utility method to create aColumnVectorfor given list of strings.static <T> List<T>toJavaList(ArrayValue arrayValue) Converts anArrayValueto a Java list.static <K,V> Map<K, V> Converts aMapValueto a Java map.
-
Method Details
-
toJavaList
Converts anArrayValueto a Java list. Any nested complex types are also converted to their Java type. -
toJavaMap
Converts aMapValueto 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 -
stringArrayValue
Creates anArrayValuefrom list of strings. The typearray(string)is a common occurrence in Delta Log schema. We don't have any non-string array type in Delta Log. If we end up needing to support other types, we can make this generic.- Parameters:
values- list of strings- Returns:
- an
ArrayValuewith the given values of typeStringType
-
stringStringMapValue
Creates aMapValuefrom map of string keys and string values. The typemap(string -> string)is a common occurrence in Delta Log schema.- Parameters:
keyValues-- Returns:
-
stringVector
Utility method to create aColumnVectorfor given list of strings.- Parameters:
values- list of strings- Returns:
- a
ColumnVectorwith the given values of typeStringType
-