DESCRIBE in Riak TS
You can use the DESCRIBE statement to obtain the definition of your Riak TS table. This document will show you how to execute DESCRIBE
in TS.
The DESCRIBE statement returns the table’s information in rows and columns.
For example:
DESCRIBE GeoCheckin
Returns:
Column | Type | Is Null | Partition Key | Local Key | Interval | Unit
-------------------------------------------------------------------------------
region | varchar | false | 1 | 1 | |
state | varchar | false | 2 | 2 | |
time | timestamp | false | 3 | 3 | 15 | m
weather | varchar | false | <null> | <null> | |
temperature | double | true | <null> | <null> | |
You can use DESCRIBE
in riak shell:
riak-shell>describe GeoCheckin;
+-----------+---------+-------+-----------+---------+--------+----+
| Column | Type |Is Null|Primary Key|Local Key|Interval|Unit|
+-----------+---------+-------+-----------+---------+--------+----+
| region | varchar | false | 1 | 1 | | |
| state | varchar | false | 2 | 2 | | |
| time |timestamp| false | 3 | 3 | 15 | m |
| weather | varchar | false | | | | |
|temperature| double | true | | | | |
+-----------+---------+-------+-----------+---------+--------+----+
Using TS’s supported clients, a successful DESCRIBE
will return a language-specific representation of the table.
- Java - Use a
Query
command to execute a DESCRIBE statement. - Ruby - Use the
Riak::TimeSeries::Query
object to execute the DESCRIBE statement. The returned results will have a collection of rows as well as acolumns
property corresponding to the above table. - Python - either the
ts_query
orts_describe
methods of the client object can be used to executed a DESCRIBE statement. In both cases, the response object will havecolumns
androws
properties corresponding to the above table. - C# - Use a
Query
command to execute a DESCRIBE statement. - Node.js - you may use the
TS.Query
command to execute a DESCRIBE statement, or use the purpose-builtTS.Describe
command. In both cases, the response object will havecolumns
androws
properties corresponding to the above table.