Array¶
array ¶
array(*cols: C) -> Array[C]
Creates an array column from the given columns.
Wrapper for pyspark.sql.functions.array.
array_append ¶
Appends value to the end of array col.
Wrapper for pyspark.sql.functions.array_append.
array_compact ¶
array_compact(col: A) -> A
Removes null elements from array col.
Wrapper for pyspark.sql.functions.array_compact.
array_contains ¶
Returns true if array col contains value.
Wrapper for pyspark.sql.functions.array_contains.
array_distinct ¶
array_distinct(col: A) -> A
Returns an array with duplicate elements removed from col.
Wrapper for pyspark.sql.functions.array_distinct.
array_except ¶
array_except(col1: A, col2: A) -> A
Returns elements in col1 that are not in col2, without duplicates.
Wrapper for pyspark.sql.functions.array_except.
array_insert ¶
Inserts value into array arr at position pos (1-based). Negative positions count from the end.
Wrapper for pyspark.sql.functions.array_insert.
array_intersect ¶
array_intersect(col1: A, col2: A) -> A
Returns the intersection of col1 and col2, without duplicates.
Wrapper for pyspark.sql.functions.array_intersect.
array_join ¶
Joins elements of string array col into a single string using delimiter.
Replaces nulls with nullReplacement when provided.
Wrapper for pyspark.sql.functions.array_join.
array_max ¶
array_max(col: Array[T]) -> T
Returns the maximum element in array col.
Wrapper for pyspark.sql.functions.array_max.
array_min ¶
array_min(col: Array[T]) -> T
Returns the minimum element in array col.
Wrapper for pyspark.sql.functions.array_min.
array_position ¶
Returns the 1-based position of the first occurrence of value in array col, or 0 if not found.
Wrapper for pyspark.sql.functions.array_position.
array_prepend ¶
Prepends value to the beginning of array col.
Wrapper for pyspark.sql.functions.array_prepend.
array_remove ¶
Removes all occurrences of element from array col.
Wrapper for pyspark.sql.functions.array_remove.
array_repeat ¶
Returns an array containing col repeated count times.
Wrapper for pyspark.sql.functions.array_repeat.
array_size ¶
Returns the number of elements in array col, or -1 for null.
Wrapper for pyspark.sql.functions.array_size.
array_sort ¶
array_sort(col: A) -> A
Returns array col sorted in ascending order, with nulls last.
Wrapper for pyspark.sql.functions.array_sort.
array_union ¶
array_union(col1: A, col2: A) -> A
Returns the union of col1 and col2, without duplicates.
Wrapper for pyspark.sql.functions.array_union.
arrays_overlap ¶
arrays_overlap(a1: A, a2: A) -> Bool
Returns true if arrays a1 and a2 share at least one non-null element.
Wrapper for pyspark.sql.functions.arrays_overlap.
broadcast ¶
broadcast(df: T) -> T
Marks df for broadcast join, hinting the optimizer to replicate it to all workers.
Wrapper for pyspark.sql.functions.broadcast.
cardinality ¶
Returns the number of elements in array col, or -1 for null.
Wrapper for pyspark.sql.functions.cardinality.
element_at ¶
Returns the element at position extraction in array col (1-based; negative counts from end).
Wrapper for pyspark.sql.functions.element_at.
try_element_at ¶
Returns the element at position extraction in array col (1-based; negative counts from end).
Returns null if the index exceeds the array length, instead of raising an error.
Wrapper for pyspark.sql.functions.try_element_at.
explode ¶
explode(col: Array[T]) -> T
Explodes array col into separate rows. Rows with null or empty arrays are dropped.
Wrapper for pyspark.sql.functions.explode.
explode_outer ¶
explode_outer(col: Array[T]) -> T
Explodes array col into separate rows, preserving null/empty arrays as a single null row.
Wrapper for pyspark.sql.functions.explode_outer.
flatten ¶
Flattens a nested array col into a single-level array.
Wrapper for pyspark.sql.functions.flatten.
sequence ¶
sequence(
start: T, stop: T, step: T | None = None
) -> Array[T]
Generates an array of values from start to stop (inclusive), incrementing by step.
Wrapper for pyspark.sql.functions.sequence.
shuffle ¶
shuffle(col: A) -> A
Returns a randomly shuffled copy of array col.
Wrapper for pyspark.sql.functions.shuffle.
size ¶
Returns the number of elements in array col, or -1 for null.
Wrapper for pyspark.sql.functions.size.
slice ¶
Returns a sub-array of col starting at start (1-based) with length elements.
Wrapper for pyspark.sql.functions.slice.
sort_array ¶
sort_array(col: A, asc: bool = True) -> A
Returns array col sorted in ascending order by default; set asc=False for descending.
Wrapper for pyspark.sql.functions.sort_array.