titlesidebar_labeldescription
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:

  • 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 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 or not this symbol column is cached
  • symbolCapacity - how many distinct values this column of symbol type 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:

  1. table_columns('my_table')
columntypeindexedindexBlockCapacitysymbolCachedsymbolCapacitydesignated
symbSYMBOLtrue1048576false256false
priceDOUBLEfalse0false0false
tsTIMESTAMPfalse0false0true
sSTRINGfalse0false0false
  1. SELECT column, type, designated FROM table_columns('my_table') WHERE designated
columntypedesignated
tsTIMESTAMPtrue
  1. SELECT type, count() FROM table_columns('my_table');
typecount
SYMBOL1
DOUBLE1
TIMESTAMP1
STRING1

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();
idnamedesignatedTimestamppartitionBymaxUncommittedRowscommitLag
1my_tabletsDAY500000300000000
2device_datanullNONE1000030000000
  1. tables() ORDER BY name DESC;
idnamedesignatedTimestamppartitionBymaxUncommittedRowscommitLag
2device_datanullNONE1000030000000
1my_tabletsDAY500000300000000
  1. tables() WHERE partitionBy = 'DAY'
idnamedesignatedTimestamppartitionBymaxUncommittedRowscommitLag
1my_tabletsDAY500000300000000