| title | sidebar_label | description |
|---|---|---|
| Meta functions | Meta | Table and database metadata function reference documentation. |
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:
1. table_columns('my_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 |
1. SELECT column, type, designated FROM table_columns('my_table') WHERE designated
| column | type | designated |
|---|---|---|
| ts | TIMESTAMP | true |
1. SELECT type, count() FROM table_columns('my_table');
| 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:
1. tables();
| id | name | designatedTimestamp | partitionBy | maxUncommittedRows | commitLag |
|---|---|---|---|---|---|
| 1 | my_table | ts | DAY | 500000 | 300000000 |
| 2 | device_data | null | NONE | 10000 | 30000000 |
1. tables() ORDER BY name DESC;
| id | name | designatedTimestamp | partitionBy | maxUncommittedRows | commitLag |
|---|---|---|---|---|---|
| 2 | device_data | null | NONE | 10000 | 30000000 |
| 1 | my_table | ts | DAY | 500000 | 300000000 |
1. tables() WHERE partitionBy = 'DAY'
| id | name | designatedTimestamp | partitionBy | maxUncommittedRows | commitLag |
|---|---|---|---|---|---|
| 1 | my_table | ts | DAY | 500000 | 300000000 |
