Table Operations#
Function |
Description |
---|---|
Create a new table and its columns from a SQL query executed against an existing table. |
|
Deletes the specified table, unregistering it. |
|
Returns the Polars execution plan for a given SQL query. |
|
Returns a list of all tables registered in the given context. |
|
Unnest one or more arrays as columns in a new table object. |
|
Remove all data from a table without actually deleting it. |
CREATE TABLE#
Create a new table and its columns from a SQL query executed against an existing table.
Example:
CREATE TABLE new_table AS
SELECT * FROM existing_table WHERE value > 42
DROP TABLES#
Deletes the specified table, unregistering it.
Example:
DROP TABLE old_table
EXPLAIN#
Returns the Polars execution plan for a given SQL query.
Example:
EXPLAIN SELECT * FROM some_table
SHOW TABLES#
Returns a list of all tables registered in the given context.
Example:
SHOW TABLES
UNNEST#
Unnest one or more arrays as columns in a new table object.
Example:
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#
Remove all data from a table without actually deleting it.
Example:
TRUNCATE TABLE some_table