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_columnstable_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 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 thissymbol
column is cachedsymbolCapacity
- how many distinct values this column ofsymbol
type 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 |
#
tablestables()
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 | walEnabled | directoryName |
---|---|---|---|---|---|---|---|
1 | my_table | ts | DAY | 500000 | 30000000 0 | false | my_table |
2 | device_data | null | NONE | 10000 | 30000000 | false | device_data |
3 | short_lived | null | HOUR | 10000 | 30000000 | false | short_lived (->) |
All tables in reverse alphabetical order
id | name | designatedTimestamp | partitionBy | maxUncommittedRows | o3MaxLag | walEnabled | directoryName |
---|---|---|---|---|---|---|---|
2 | device_data | null | NONE | 10000 | 30000000 | false | device_data |
1 | my_table | ts | DAY | 500000 | 300000000 | false | my_table |
3 | short_lived | ts | HOUR | 10000 | 30000000 | false | short_lived (->) |
note
(->)
means the table was created using the IN VOLUME clause.
All tables with a daily partitioning strategy
id | name | designatedTimestamp | partitionBy | maxUncommittedRows | walEnabled | directoryName |
---|---|---|---|---|---|---|
1 | my_table | ts | DAY | 500000 | true | my_table |
#
wal_tableswal_tables()
returns the WAL status for all WAL tables in the database.
Arguments:
wal_tables()
does not require arguments.
Return value:
Returns a table
including the following information:
name
- table namesuspended
- suspended status flagwriterTxn
- the last committed transaction in TableWritersequencerTxn
- the last committed transaction in the sequencer
Examples:
List all tables
name | suspended | writerTxn | sequencerTxn |
---|---|---|---|
sensor_wal | false | 2 | 4 |
weather_wal | false | 3 | 3 |
test_wal | true | 7 | 9 |