Class

doric.syntax.ArrayColumns

ArrayColumnSyntax

Related Doc: package ArrayColumns

Permalink

implicit class ArrayColumnSyntax[T, F[_]] extends AnyRef

Extension methods for arrays

Linear Supertypes
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. ArrayColumnSyntax
  2. AnyRef
  3. Any
Implicitly
  1. by LiteralOps
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ArrayColumnSyntax(col: DoricColumn[F[T]])(implicit arg0: CollectionType[F])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from ArrayColumnSyntax[T, F] to any2stringadd[ArrayColumnSyntax[T, F]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ArrayColumnSyntax[T, F], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from ArrayColumnSyntax[T, F] to ArrowAssoc[ArrayColumnSyntax[T, F]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def aggregate[A](zero: DoricColumn[A])(merge: (DoricColumn[A], DoricColumn[T]) ⇒ DoricColumn[A]): DoricColumn[A]

    Permalink

    Aggregates (reduce) the array with the provided functions, similar to scala fold left in collections.

    Aggregates (reduce) the array with the provided functions, similar to scala fold left in collections.

    A

    type of the transformed values.

    zero

    zero value.

    merge

    function to combine the previous result with the element of the array.

    returns

    the column reference with the applied transformation.

    To do

    scaladoc link (issue #135)

    See also

    org.apache.spark.sql.functions.aggregate

  7. def aggregateWT[A, B](zero: DoricColumn[A])(merge: (DoricColumn[A], DoricColumn[T]) ⇒ DoricColumn[A], finish: (DoricColumn[A]) ⇒ DoricColumn[B]): DoricColumn[B]

    Permalink

    Aggregates (reduce) the array with the provided functions, similar to scala fold left in collections, with a final transformation.

    Aggregates (reduce) the array with the provided functions, similar to scala fold left in collections, with a final transformation.

    A

    type of the intermediate values

    B

    type of the final value to return

    zero

    zero value

    merge

    function to combine the previous result with the element of the array

    finish

    the final transformation

    returns

    the column reference with the applied transformation.

    To do

    scaladoc link (issue #135)

    See also

    org.apache.spark.sql.functions.aggregate

  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def contains[A](value: DoricColumn[A]): BooleanColumn

    Permalink

    Returns null if the array is null, true if the array contains value, and false otherwise.

    Returns null if the array is null, true if the array contains value, and false otherwise.

    See also

    org.apache.spark.sql.functions.array_contains

  11. def distinct: ArrayColumn[T]

    Permalink

    Removes duplicate values from the array.

    Removes duplicate values from the array.

    See also

    org.apache.spark.sql.functions.array_distinct

  12. def elementAt(pos: IntegerColumn): DoricColumn[T]

    Permalink

    Returns element of array at given index in value.

    Returns element of array at given index in value.

    See also

    org.apache.spark.sql.functions.element_at

  13. def ensuring(cond: (ArrayColumnSyntax[T, F]) ⇒ Boolean, msg: ⇒ Any): ArrayColumnSyntax[T, F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from ArrayColumnSyntax[T, F] to Ensuring[ArrayColumnSyntax[T, F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: (ArrayColumnSyntax[T, F]) ⇒ Boolean): ArrayColumnSyntax[T, F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from ArrayColumnSyntax[T, F] to Ensuring[ArrayColumnSyntax[T, F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean, msg: ⇒ Any): ArrayColumnSyntax[T, F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from ArrayColumnSyntax[T, F] to Ensuring[ArrayColumnSyntax[T, F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean): ArrayColumnSyntax[T, F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from ArrayColumnSyntax[T, F] to Ensuring[ArrayColumnSyntax[T, F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  19. def except(col2: ArrayColumn[T]): ArrayColumn[T]

    Permalink

    Returns an array of the elements in the first array but not in the second array, without duplicates.

    Returns an array of the elements in the first array but not in the second array, without duplicates. The order of elements in the result is not determined

    See also

    org.apache.spark.sql.functions.array_except

  20. def exists(fun: (DoricColumn[T]) ⇒ BooleanColumn): BooleanColumn

    Permalink

    Returns whether a predicate holds for one or more elements in the array.

    Returns whether a predicate holds for one or more elements in the array.

    Example:
    1. df.select(colArray("i").exists(_ % 2 === 0))
    To do

    scaladoc link not available for spark 2.4

    See also

    org.apache.spark.sql.functions.exists

  21. def explode: DoricColumn[T]

    Permalink

    Creates a new row for each element in the given array column.

    Creates a new row for each element in the given array column.

    See also

    org.apache.spark.sql.functions.explode

  22. def explodeOuter: DoricColumn[T]

    Permalink

    Creates a new row for each element in the given array column.

    Creates a new row for each element in the given array column. Unlike explode, if the array is null or empty then null is produced.

    See also

    org.apache.spark.sql.functions.explode_outer

  23. def filter(p: (DoricColumn[T]) ⇒ BooleanColumn): DoricColumn[F[T]]

    Permalink

    Filters the array elements using the provided condition.

    Filters the array elements using the provided condition.

    p

    the condition to filter.

    returns

    the column reference with the filter applied.

    To do

    scaladoc link (issue #135)

    See also

    org.apache.spark.sql.functions.filter

  24. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from ArrayColumnSyntax[T, F] to StringFormat[ArrayColumnSyntax[T, F]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  26. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  27. def getIndex(n: Int): DoricColumn[T]

    Permalink

    Selects the nth element of the array, returns null value if the length is shorter than n.

    Selects the nth element of the array, returns null value if the length is shorter than n.

    n

    the index of the element to retrieve.

    returns

    the DoricColumn with the selected element.

  28. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  29. def intersect(col2: ArrayColumn[T]): ArrayColumn[T]

    Permalink

    Returns an array of the elements in the intersection of the given two arrays, without duplicates.

    Returns an array of the elements in the intersection of the given two arrays, without duplicates.

    See also

    org.apache.spark.sql.functions.array_intersect

  30. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  31. def join(delimiter: StringColumn): StringColumn

    Permalink

    Concatenates the elements of column using the delimiter.

    Concatenates the elements of column using the delimiter. Nulls are deleted

    To do

    scaladoc link (issue #135)

    See also

    org.apache.spark.sql.functions.array_join

  32. def join(delimiter: StringColumn, nullReplacement: StringColumn): StringColumn

    Permalink

    Concatenates the elements of column using the delimiter.

    Concatenates the elements of column using the delimiter. Null values are replaced with nullReplacement.

    To do

    scaladoc link (issue #135)

    See also

    org.apache.spark.sql.functions.array_join

  33. def lit(implicit l: Location): LiteralDoricColumn[ArrayColumnSyntax[T, F]]

    Permalink

    Transforms the original value to a literal.

    Transforms the original value to a literal.

    returns

    a literal with the same type.

    Implicit information
    This member is added by an implicit conversion from ArrayColumnSyntax[T, F] to doric.LiteralOps[ArrayColumnSyntax[T, F]] performed by method LiteralOps in doric.syntax.LiteralConversions. This conversion will take place only if an implicit value of type SparkType[ArrayColumnSyntax[T, F]] is in scope and at the same time an implicit value of type LiteralSparkType[ArrayColumnSyntax[T, F]] is in scope.
    Definition Classes
    LiteralOps
    Annotations
    @inline()
  34. def mapFromArrays[V](values: DoricColumn[F[V]]): MapColumn[T, V]

    Permalink

    Creates a new map column.

    Creates a new map column. The array in the first column is used for keys. The array in the second column is used for values.

    Exceptions thrown

    java.lang.RuntimeException if arrays doesn't have the same length. or if a key is null

    See also

    org.apache.spark.sql.functions.map_from_arrays

  35. def max: DoricColumn[T]

    Permalink

    Returns the maximum value in the array.

    Returns the maximum value in the array.

    See also

    org.apache.spark.sql.functions.array_max

  36. def min: DoricColumn[T]

    Permalink

    Returns the minimum value in the array.

    Returns the minimum value in the array.

    See also

    org.apache.spark.sql.functions.array_min

  37. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  38. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  39. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  40. def overlaps(col2: DoricColumn[F[T]]): BooleanColumn

    Permalink

    Returns true if a1 and a2 have at least one non-null element in common.

    Returns true if a1 and a2 have at least one non-null element in common. If not and both the arrays are non-empty and any of them contains a null, it returns null. It returns false otherwise.

    See also

    org.apache.spark.sql.functions.arrays_overlap

  41. def posExplode: DoricColumn[Row]

    Permalink

    Creates a new row for each element with position in the given array column.

    Creates a new row for each element with position in the given array column.

    Example:
    1.    ORIGINAL        SPARK         DORIC
      +------------+   +---+---+     +------+
      |col         |   |pos|col|     |col   |
      +------------+   +---+---+     +------+
      |[a, b, c, d]|   |0  |a  |     |{0, a}|
      |[e]         |   |1  |b  |     |{1, b}|
      |[]          |   |2  |c  |     |{2, c}|
      |null        |   |3  |d  |     |{3, d}|
      +------------+   |0  |e  |     |{0, e}|
                       +---+---+     +------+
    Note

    WARNING: Unlike spark, doric returns a struct

    ,

    Uses the default column name pos for position, and value for elements in the array

    See also

    org.apache.spark.sql.functions.posexplode

  42. def posExplodeOuter: DoricColumn[Row]

    Permalink

    Creates a new row for each element with position in the given array column.

    Creates a new row for each element with position in the given array column. Unlike posexplode, if the array is null or empty then the row null is produced.

    Example:
    1.    ORIGINAL        SPARK         DORIC
      +------------+   +----+----+     +------+
      |col         |   |pos |col |     |col   |
      +------------+   +----+----+     +------+
      |[a, b, c, d]|   |0   |a   |     |{0, a}|
      |[e]         |   |1   |b   |     |{1, b}|
      |[]          |   |2   |c   |     |{2, c}|
      |null        |   |3   |d   |     |{3, d}|
      +------------+   |0   |e   |     |{0, e}|
                       |null|null|     |null  |
                       |null|null|     |null  |
                       +----+----+     +------+
    Note

    WARNING: Unlike spark, doric returns a struct

    ,

    Uses the default column name pos for position, and col for elements in the array

    See also

    org.apache.spark.sql.functions.posexplode_outer

  43. def positionOf[B](col2: DoricColumn[B]): LongColumn

    Permalink

    Locates the position of the first occurrence of the value in the given array as long.

    Locates the position of the first occurrence of the value in the given array as long. Returns null if either of the arguments are null.

    Note

    The position is not zero based, but 1 based index. Returns 0 if value could not be found in array.

    See also

    org.apache.spark.sql.functions.array_position

  44. def remove[B](col2: DoricColumn[B]): ArrayColumn[T]

    Permalink

    Remove all elements that equal to element from the given array.

    Remove all elements that equal to element from the given array.

    See also

    org.apache.spark.sql.functions.array_remove

  45. def reverse: DoricColumn[F[T]]

    Permalink

    Returns an array with reverse order of elements.

    Returns an array with reverse order of elements.

    See also

    org.apache.spark.sql.functions.reverse

  46. def shuffle: DoricColumn[F[T]]

    Permalink

    Returns a random permutation of the given array.

    Returns a random permutation of the given array.

    Note

    The function is non-deterministic.

    See also

    org.apache.spark.sql.functions.shuffle

  47. def size: IntegerColumn

    Permalink

    Returns length of array.

    Returns length of array.

    The function returns null for null input if spark.sql.legacy.sizeOfNull is set to false or spark.sql.ansi.enabled is set to true. Otherwise, the function returns -1 for null input. With the default settings, the function returns -1 for null input.

    See also

    org.apache.spark.sql.functions.size

  48. def slice(start: IntegerColumn, length: IntegerColumn): DoricColumn[F[T]]

    Permalink

    Returns an array containing all the elements in the column from index start (or starting from the end if start is negative) with the specified length.

    Returns an array containing all the elements in the column from index start (or starting from the end if start is negative) with the specified length.

    To do

    scaladoc link (issue #135)

    Note

    if start == 0 an exception will be thrown

    See also

    org.apache.spark.sql.functions.slice

  49. def sort(asc: BooleanColumn): DoricColumn[F[T]]

    Permalink

    Sorts the input array for the given column in ascending or descending order, according to the natural ordering of the array elements.

    Sorts the input array for the given column in ascending or descending order, according to the natural ordering of the array elements. Null elements will be placed at the beginning of the returned array in ascending order or at the end of the returned array in descending order.

    See also

    org.apache.spark.sql.functions.sort_array

  50. def sortAscNullsFirst: DoricColumn[F[T]]

    Permalink

    Sorts the input array for the given column in ascending order, according to the natural ordering of the array elements.

    Sorts the input array for the given column in ascending order, according to the natural ordering of the array elements. Null elements will be placed at the beginning of the returned array.

    See also

    org.apache.spark.sql.functions.sort_array

  51. def sortAscNullsLast: DoricColumn[F[T]]

    Permalink

    Sorts the input array in ascending order.

    Sorts the input array in ascending order. The elements of the input array must be orderable. Null elements will be placed at the end of the returned array.

    See also

    https://spark.apache.org/docs/latest/api/scala/org/apache/spark/sql/functions$.html#array_sort(e:org.apache.spark.sql.Column):org.apache.spark.sql.Column

  52. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  53. def toJson(options: Map[String, String] = Map.empty): StringColumn

    Permalink

    Converts a column containing a StructType into a JSON string with the specified schema.

    Converts a column containing a StructType into a JSON string with the specified schema.

    Exceptions thrown

    java.lang.IllegalArgumentException in the case of an unsupported type.

    To do

    scaladoc link (issue #135)

    See also

    org.apache.spark.sql.functions.to_json(e:org\.apache\.spark\.sql\.Column,options:scala\.collection\.immutable\.Map\[java\.lang\.String,java\.lang\.String\]):* org.apache.spark.sql.functions.to_csv

  54. def toMap[V](values: DoricColumn[F[V]]): MapColumn[T, V]

    Permalink

    Creates a new map column.

    Creates a new map column. The array in the first column is used for keys. The array in the second column is used for values.

    Exceptions thrown

    java.lang.RuntimeException if arrays doesn't have the same length or if a key is null

    See also

    mapFromArrays

  55. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  56. def transform[A](fun: (DoricColumn[T]) ⇒ DoricColumn[A]): DoricColumn[F[A]]

    Permalink

    Transform each element with the provided function.

    Transform each element with the provided function.

    A

    the type of the array elements to return.

    fun

    lambda with the transformation to apply.

    returns

    the column reference with the applied transformation.

    To do

    scaladoc link (issue #135)

    See also

    org.apache.spark.sql.functions.transform

  57. def transformWithIndex[A](fun: (DoricColumn[T], IntegerColumn) ⇒ DoricColumn[A]): DoricColumn[F[A]]

    Permalink

    Transform each element of the array with the provided function that provides the index of the element in the array.

    Transform each element of the array with the provided function that provides the index of the element in the array.

    A

    the type of the elements of the array

    fun

    the lambda that takes in account the element of the array and the index and returns a new element.

    returns

    the column reference with the provided transformation.

    To do

    scaladoc link (issue #135)

    See also

    org.apache.spark.sql.functions.transform

  58. def union(cols: DoricColumn[F[T]]*): DoricColumn[F[T]]

    Permalink

    Returns an array of the elements in the union of the given N arrays, without duplicates.

    Returns an array of the elements in the union of the given N arrays, without duplicates.

    See also

    org.apache.spark.sql.functions.array_union

  59. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. def zip(other: DoricColumn[F[T]], others: DoricColumn[F[T]]*): DoricColumn[F[Row]]

    Permalink

    Returns a merged array of structs in which the N-th struct contains all N-th values of input arrays.

    Returns a merged array of structs in which the N-th struct contains all N-th values of input arrays.

    See also

    org.apache.spark.sql.functions.arrays_zip

  63. def zipWith[T2](col2: DoricColumn[F[T2]]): Zipper[T, T2, F]

    Permalink

    Merge two given arrays, element-wise, into a single array using a function.

    Merge two given arrays, element-wise, into a single array using a function. If one array is shorter, nulls are appended at the end to match the length of the longer array, before applying the function.

    Example:
    1. df.select(colArray("val1").zipWith(col("val2"), concat(_, _)))
    To do

    scaladoc link not available for spark 2.4

    See also

    org.apache.spark.sql.functions.zip_with

  64. def zipWithIndex(indexName: CName = "index".cname, valueName: CName = "value".cname): DoricColumn[F[Row]]

    Permalink

    DORIC EXCLUSIVE! Given any array[e] column this method will return a new array struct[i, e] column, where the first element is the index and the second element is the value itself

  65. def [B](y: B): (ArrayColumnSyntax[T, F], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from ArrayColumnSyntax[T, F] to ArrowAssoc[ArrayColumnSyntax[T, F]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion LiteralOps from ArrayColumnSyntax[T, F] to doric.LiteralOps[ArrayColumnSyntax[T, F]]

Inherited by implicit conversion any2stringadd from ArrayColumnSyntax[T, F] to any2stringadd[ArrayColumnSyntax[T, F]]

Inherited by implicit conversion StringFormat from ArrayColumnSyntax[T, F] to StringFormat[ArrayColumnSyntax[T, F]]

Inherited by implicit conversion Ensuring from ArrayColumnSyntax[T, F] to Ensuring[ArrayColumnSyntax[T, F]]

Inherited by implicit conversion ArrowAssoc from ArrayColumnSyntax[T, F] to ArrowAssoc[ArrayColumnSyntax[T, F]]

Array Type

Ungrouped