Class VectorUtils

Object
io.delta.kernel.internal.util.VectorUtils

public final class VectorUtils extends Object
  • Method Details

    • toJavaList

      public static <T> List<T> toJavaList(ArrayValue arrayValue)
      Converts an ArrayValue to a Java list. Any nested complex types are also converted to their Java type.
    • toJavaMap

      public static <K, V> Map<K,V> toJavaMap(MapValue mapValue)
      Converts a 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
    • stringArrayValue

      public static ArrayValue stringArrayValue(List<String> values)
      Creates an 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.
      Parameters:
      values - list of strings
      Returns:
      an ArrayValue with the given values of type StringType
    • stringStringMapValue

      public static MapValue stringStringMapValue(Map<String,String> keyValues)
      Creates a MapValue from map of string keys and string values. The type map(string -> string) is a common occurrence in Delta Log schema.
      Parameters:
      keyValues -
      Returns:
    • stringVector

      public static ColumnVector stringVector(List<String> values)
      Utility method to create a ColumnVector for given list of strings.
      Parameters:
      values - list of strings
      Returns:
      a ColumnVector with the given values of type StringType