Skip to content

Commit

Permalink
unnest table function
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed May 31, 2024
1 parent 77fca84 commit 208a10d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion py-polars/docs/source/reference/sql/functions/array.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Array
* - :ref:`ARRAY_UPPER <array_upper>`
- Returns the upper bound (max value) in an array.
* - :ref:`UNNEST <unnest>`
- Unnests/explodes an array column into multiple rows.
- Unnests (explodes) an array column into multiple rows.

.. _array_contains:

Expand Down
19 changes: 19 additions & 0 deletions py-polars/docs/source/reference/sql/table_operations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Table Operations
- Returns logical plan of the query.
* - :ref:`SHOW TABLES <show_tables>`
- Returns a list of all tables in the context.
* - :ref:`UNNEST <unnest>`
- Unnest one or more arrays as columns in a new table.
* - :ref:`TRUNCATE <truncate>`
- Remove rows from table without deleting the table from context.

Expand Down Expand Up @@ -66,6 +68,23 @@ Display the list of tables in the context.
SHOW TABLES
.. _unnest:

UNNEST
------
Unnest one or more arrays as columns in a new table.

**Example:**

.. code-block:: sql
SELECT * FROM
UNNEST(
[1, 2, 3, 4],
['ww','xx','yy','zz'],
[23.0, 24.5, 28.0, 27.5]
) AS tbl (x,y,z)
.. _truncate:

TRUNCATE
Expand Down

0 comments on commit 208a10d

Please sign in to comment.