From 0aee7c78696e40e912a9a055b2c150afd63b6671 Mon Sep 17 00:00:00 2001 From: Siew Kam Onn Date: Tue, 12 Nov 2024 09:57:29 +0800 Subject: [PATCH] Amend list_ to array_ in documentation --- .../user-guide/common-operations/expressions.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/user-guide/common-operations/expressions.rst b/docs/source/user-guide/common-operations/expressions.rst index 65006be1..e94e1a6b 100644 --- a/docs/source/user-guide/common-operations/expressions.rst +++ b/docs/source/user-guide/common-operations/expressions.rst @@ -110,31 +110,31 @@ This function returns an integer indicating the total number of elements in the In this example, the `num_elements` column will contain `3` for both rows. -To concatenate two arrays, you can use the function :py:func:`datafusion.functions.list_cat` or :py:func:`datafusion.functions.list_concat`. +To concatenate two arrays, you can use the function :py:func:`datafusion.functions.array_cat` or :py:func:`datafusion.functions.array_concat`. These functions return a new array that is the concatenation of the input arrays. .. ipython:: python from datafusion import SessionContext, col - from datafusion.functions import list_cat, list_concat + from datafusion.functions import array_cat, array_concat ctx = SessionContext() df = ctx.from_pydict({"a": [[1, 2, 3]], "b": [[4, 5, 6]]}) - df.select(list_cat(col("a"), col("b")).alias("concatenated_array")) + df.select(array_cat(col("a"), col("b")).alias("concatenated_array")) In this example, the `concatenated_array` column will contain `[1, 2, 3, 4, 5, 6]`. -To repeat the elements of an array a specified number of times, you can use the function :py:func:`datafusion.functions.list_repeat`. +To repeat the elements of an array a specified number of times, you can use the function :py:func:`datafusion.functions.array_repeat`. This function returns a new array with the elements repeated. .. ipython:: python from datafusion import SessionContext, col, literal - from datafusion.functions import list_repeat + from datafusion.functions import array_repeat ctx = SessionContext() df = ctx.from_pydict({"a": [[1, 2, 3]]}) - df.select(list_repeat(col("a"), literal(2)).alias("repeated_array")) + df.select(array_repeat(col("a"), literal(2)).alias("repeated_array")) In this example, the `repeated_array` column will contain `[[1, 2, 3], [1, 2, 3]]`.