all_tables

all_tables() returns all tables in the database.

Arguments:

  • all_tables() does not require arguments.

Return value:

Returns a table.

Examples:

  • Get all tables in the database
  1. all_tables();
tableName
table1
table2
  • Get all tables in the database that match ‘sales’
  1. all_tables() WHERE tableName ~= 'sales';
tableName
sales-north
sales-west
sales-east
sales-south
  • Get all tables in reverse alphabetical order
  1. 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

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