describe


describe | desc [as json] 
 {table table_name [field_name[,...] ] |
 index index_name on table_name
 } 

表または索引に関する情報を記述します。オプションでJSON形式を使用できます。

完全修飾table_nameを次のように指定します。
エントリ指定 説明
table_name 必須。表の完全な名前を指定します。それ以上の修飾子がない場合、このエントリはデフォルトのネームスペース(sysdefault)に作成された表を示します。このネームスペースを指定する必要はありません。
parent-table.child-table 親の子表を指定します。親表、ピリオド(.)、子の名前の順に指定します。たとえば、親表がUsersの場合、MailingAddressという名前の子表はUsers.MailingAddressと指定します。

namespace-name:table-name

デフォルト以外のネームスペースに作成された表を指定します。ネームスペースの後にコロン(:)を付けて使用します。たとえば、Salesネームスペースに作成されたUsers表を参照するには、table_nameSales:Usersのように入力します。
次に、表ns1:t1に対するdescribeの出力を示します。
sql-> describe table ns1:t1;
 === Information ===
 +-----------+------+-----+-------+----------+----------+--------+----------+---------+-------------+
 | namespace | name | ttl | owner | sysTable | r2compat | parent | children | indexes | description |
 +-----------+------+-----+-------+----------+----------+--------+----------+---------+-------------+
 | ns1       | t1   |     |       | N        | N        |        |          |         |             |
 +-----------+------+-----+-------+----------+----------+--------+----------+---------+-------------+

 === Fields ===
 +----+------+---------+----------+-----------+----------+------------+----------+
 | id | name |  type   | nullable |  default  | shardKey | primaryKey | identity |
 +----+------+---------+----------+-----------+----------+------------+----------+
 |  1 | id   | Integer | N        | NullValue | Y        | Y          |          |
 +----+------+---------+----------+-----------+----------+------------+----------+
 |  2 | name | String  | Y        | NullValue |          |            |          |
 +----+------+---------+----------+-----------+----------+------------+----------+

sql->
次の例では、同じ表に対してdescribe as jsonを使用しています。
sql-> describe as json table ns1:t1;
{
  "json_version" : 1,
  "type" : "table",
  "name" : "t1",
  "namespace" : "ns1",
  "shardKey" : [ "id" ],
  "primaryKey" : [ "id" ],
  "fields" : [ {
    "name" : "id",
    "type" : "INTEGER",
    "nullable" : false,
    "default" : null
  }, {
    "name" : "name",
    "type" : "STRING",
    "nullable" : true,
    "default" : null
  } ]
}