Meta functions

all_tables#

all_tables() returns a list of tables.

Arguments#

  • all_tables() does not require arguments.

Description#

Returns all tables in the database.

Return value#

Returns a table.

Examples#

  • Get all tables in the database
all_tables();
tableName
table1
table2
...
  • Get all tables in the database that match 'sales'
all_tables() WHERE tableName ~= 'sales';
tableName
sales-north
sales-west
sales-east
sales-south
  • Get all tables in reverse alphabetical order
all_tables() ORDER BY tableName DESC;
tableName
table_n
table_n-1
table_n-2
...

table_columns#

table_columns('tableName') returns the schema of a table

Arguments#

  • tableName is the name of an existing table as a string

Description#

Returns the schema of the target table.

Return value#

Returns a table with two columns:

  • columnName - name of the available columns in the table
  • columnType - type of the column

Examples#

  • Get all columns in the table
table_columns('myTable')
columnNamecolumnType
TSTIMESTAMP
NameSTRING
AgeINT
SexSYMBOL
GradeDOUBLE
......
  • Get all columns in the database that match the name 'sales'
SELECT columnName FROM table_columns('myTable') WHERE columnName ~= 'sales';
columnName
sales-north
sales-west
sales-east
sales-south
  • Get the count of column types
SELECT columnType, count() FROM table_columns('wthr');
columnTypecount
INT4
DOUBLE8
SYMBOL2