Meta functions
These functions provide table information including column details and metadata. These functions are particularly useful for checking if tables contain a designated timestamp column.
table_columns#
table_columns('tableName') returns the schema of a table
Arguments:
- tableNameis the name of an existing table as a string
Return value:
Returns a table with the following columns:
- column- name of the available columns in the table
- type- type of the column
- indexed- if indexing is applied to this column
- indexBlockCapacity- how many row IDs to store in a single storage block on disk
- symbolCached- whether this- symbolcolumn is cached
- symbolCapacity- how many distinct values this column of- symboltype is expected to have
- designated- if this is set as the designated timestamp column for this table
For more details on the meaning and use of these values, see the CREATE TABLE documentation.
Examples:
Get all columns in a table
| column | type | indexed | indexBlockCapacity | symbolCached | symbolCapacity | designated | 
|---|---|---|---|---|---|---|
| symb | SYMBOL | true | 1048576 | false | 256 | false | 
| price | DOUBLE | false | 0 | false | 0 | false | 
| ts | TIMESTAMP | false | 0 | false | 0 | true | 
| s | STRING | false | 0 | false | 0 | false | 
Get designated timestamp column
| column | type | designated | 
|---|---|---|
| ts | TIMESTAMP | true | 
Get the count of column types
| type | count | 
|---|---|
| SYMBOL | 1 | 
| DOUBLE | 1 | 
| TIMESTAMP | 1 | 
| STRING | 1 | 
tables#
tables() returns all tables in the database including table metadata.
Arguments:
- tables()does not require arguments.
Return value:
Returns a table.
Examples:
List all tables
| id | name | designatedTimestamp | partitionBy | maxUncommittedRows | o3MaxLag | 
|---|---|---|---|---|---|
| 1 | my_table | ts | DAY | 500000 | 300000000 | 
| 2 | device_data | null | NONE | 10000 | 30000000 | 
All tables in reverse alphabetical order
| id | name | designatedTimestamp | partitionBy | maxUncommittedRows | o3MaxLag | 
|---|---|---|---|---|---|
| 2 | device_data | null | NONE | 10000 | 30000000 | 
| 1 | my_table | ts | DAY | 500000 | 300000000 | 
All tables with a daily partitioning strategy
| id | name | designatedTimestamp | partitionBy | maxUncommittedRows | 
|---|---|---|---|---|
| 1 | my_table | ts | DAY | 500000 |