Meta functions
These functions provide table information including column details and metadata such as commit lag parameters. 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 tabletype- type of the columnindexed- if indexing is applied to this columnindexBlockCapacity- how many row IDs to store in a single storage block on disksymbolCached- whether or not thissymbolcolumn is cachedsymbolCapacity- how many distinct values this column ofsymboltype is expected to havedesignated- 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.
info
commitLag is returned in microseconds
Arguments:
tables()does not require arguments.
Return value:
Returns a table.
Examples:
List all tables
| id | name | designatedTimestamp | partitionBy | maxUncommittedRows | commitLag |
|---|---|---|---|---|---|
| 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 | commitLag |
|---|---|---|---|---|---|
| 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 | commitLag |
|---|---|---|---|---|---|
| 1 | my_table | ts | DAY | 500000 | 300000000 |