public final class VectorUtils
extends Object
| Modifier and Type | Method and Description |
|---|---|
static ArrayValue |
stringArrayValue(java.util.List<String> values)
Creates an
ArrayValue from list of strings. |
static MapValue |
stringStringMapValue(java.util.Map<String,String> keyValues)
Creates a
MapValue from map of string keys and string values. |
static ColumnVector |
stringVector(java.util.List<String> values)
Utility method to create a
ColumnVector for given list of strings. |
static <T> java.util.List<T> |
toJavaList(ArrayValue arrayValue)
Converts an
ArrayValue to a Java list. |
static <K,V> java.util.Map<K,V> |
toJavaMap(MapValue mapValue)
Converts a
MapValue to a Java map. |
public static <T> java.util.List<T> toJavaList(ArrayValue arrayValue)
ArrayValue to a Java list. Any nested complex types are also converted to
their Java type.public static <K,V> java.util.Map<K,V> toJavaMap(MapValue mapValue)
MapValue 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
public static ArrayValue stringArrayValue(java.util.List<String> values)
ArrayValue from list of strings. The type array(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.values - list of stringsArrayValue with the given values of type StringTypepublic static MapValue stringStringMapValue(java.util.Map<String,String> keyValues)
MapValue from map of string keys and string values. The type map(string -> string) is a common occurrence in Delta Log schema.keyValues - public static ColumnVector stringVector(java.util.List<String> values)
ColumnVector for given list of strings.values - list of stringsColumnVector with the given values of type StringType