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 | Nullable | Partition Key | Local Key | Interval | Unit | Sort Order
---------------------------------------------------------------------------------|-----------
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 |Nullable|Partition Key|Local Key|Interval|Unit|Sort Order|
+-----------+---------+--------+-------------+---------+--------+----+----------+
| 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
Querycommand to execute a DESCRIBE statement. - Ruby - Use the
Riak::TimeSeries::Queryobject to execute the DESCRIBE statement. The returned results will have a collection of rows as well as acolumnsproperty corresponding to the above table. - Python - either the
ts_queryorts_describemethods of the client object can be used to executed a DESCRIBE statement. In both cases, the response object will havecolumnsandrowsproperties corresponding to the above table. - C# - Use a
Querycommand to execute a DESCRIBE statement. - Node.js - you may use the
TS.Querycommand to execute a DESCRIBE statement, or use the purpose-builtTS.Describecommand. In both cases, the response object will havecolumnsandrowsproperties corresponding to the above table.
