Table Operations#

Function

Description

CREATE TABLE

Create a new table and its columns from a SQL query against an existing table.

DROP TABLES

Delete a specified table and related data.

EXPLAIN

Returns logical plan of the query.

SHOW TABLES

Returns a list of all tables in the context.

UNNEST

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

TRUNCATE

Remove rows from table without deleting the table from context.

CREATE TABLE#

Create a new table and its columns from a SQL query against an existing table.

Example:

CREATE TABLE new_table AS SELECT * FROM df WHERE value > 42

DROP TABLES#

Delete a specified table and related data.

Example:

DROP TABLE old_table

EXPLAIN#

Returns Logical Plan of the query.

Example:

EXPLAIN SELECT * FROM df

SHOW TABLES#

Display the list of tables in the context.

Example:

SHOW TABLES

UNNEST#

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

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#

Removes all rows from the specified table, but keeps the table.

Example:

TRUNCATE TABLE df