7.3.12. column_list¶
7.3.12.1. Summary¶
column_list command lists columns in a table.
7.3.12.2. Syntax¶
This command takes only one required parameter:
column_list table
7.3.12.3. Usage¶
Here is a simple example of column_list command.
Execution example:
table_create Users TABLE_PAT_KEY ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Users age COLUMN_SCALAR UInt8
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Users tags COLUMN_VECTOR ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_list Users
# [
# [
# 0,
# 1337566253.89858,
# 0.000355720520019531
# ],
# [
# [
# [
# "id",
# "UInt32"
# ],
# [
# "name",
# "ShortText"
# ],
# [
# "path",
# "ShortText"
# ],
# [
# "type",
# "ShortText"
# ],
# [
# "flags",
# "ShortText"
# ],
# [
# "domain",
# "ShortText"
# ],
# [
# "range",
# "ShortText"
# ],
# [
# "source",
# "ShortText"
# ]
# ],
# [
# 256,
# "_key",
# "",
# "",
# "COLUMN_SCALAR",
# "Users",
# "ShortText",
# []
# ],
# [
# 257,
# "age",
# "/tmp/groonga-databases/commands_column_list.0000101",
# "fix",
# "COLUMN_SCALAR|PERSISTENT",
# "Users",
# "UInt8",
# []
# ],
# [
# 258,
# "tags",
# "/tmp/groonga-databases/commands_column_list.0000102",
# "var",
# "COLUMN_VECTOR|PERSISTENT",
# "Users",
# "ShortText",
# []
# ]
# ]
# ]
7.3.12.4. Parameters¶
This section describes parameters of column_list.
7.3.12.4.1. Required parameters¶
All parameters are required.
7.3.12.4.1.1. table¶
Specifies the name of table to be listed columns.
7.3.12.5. Return value¶
column_list returns the list of column information in the table:
[
HEADER,
[
COLUMN_LIST_HEADER,
COLUMN_INFORMATION1,
COLUMN_INFORMATION2,
...
]
]
HEADER
See Output format about
HEADER.
COLUMN_LIST_HEADER
COLUMN_LIST_HEADERdescribes about content of eachCOLUMN_INFORMATION.
COLUMN_LIST_HEADERis the following format:[ ["id", "UInt32"], ["name", "ShortText"], ["path", "ShortText"], ["type", "ShortText"], ["flags", "ShortText"], ["domain", "ShortText"], ["range", "ShortText"], ["source", "ShortText"] ]It means the following:
The first content in
COLUMN_INFORMATIONisidvalue and the value type isUInt32.The second content in
COLUMN_INFORMATIONisnamevalue and the value type isShortText.The third content ….
See the following
COLUMN_INFORMATIONdescription for details.This field provides meta-data of column information. So this field will be useful for programs rather than humans.
COLUMN_INFORMATION
Each
COLUMN_INFORMATIONis the following format:[ ID, NAME, PATH, TYPE, FLAGS, DOMAIN, RANGE, SOURCES ]
IDThe column ID in the Groonga database. Normally, you don’t care about it.
NAMEThe column name.
PATHThe path for storing column data.
TYPEThe type of the column. It is one of the followings:
Value
Description
fixThe column is a fixed size column. Scalar column that its type is fixed size type is fixed size column.
varThe column is a variable size column. Vector column or scalar column that its type is variable size type are variable size column.
indexThe column is an index column.
FLAGSThe flags of the column. Each flag is separated by
|likeCOLUMN_VECTOR|WITH_WEIGHT.FLAGSmust include one ofCOLUMN_SCALAR,COLUMN_VECTORorCOLUMN_INDEX. Other flags are optional.Here is the available flags:
Flag
Description
COLUMN_SCALARThe column is a scalar column.
COLUMN_VECTORThe column is a vector column.
COLUMN_INDEXThe column is an index column.
WITH_WEIGHTThe column can have weight.
COLUMN_VECTORandCOLUMN_INDEXmay have it.COLUMN_SCALARdoesn’t have it.
WITH_SECTIONThe column can have section information.
COLUMN_INDEXmay have it.COLUMN_SCALARandCOLUMN_VECTORdon’t have it.Multiple column index has it.
WITH_POSITIONThe column can have position information.
COLUMN_INDEXmay have it.COLUMN_SCALARandCOLUMN_VECTORdon’t have it.Full text search index must has it.
PERSISTENTThe column is a persistent column. It means that the column isn’t a Pseudo column.
DOMAINThe name of table that has the column.
RANGEThe value type name of the column. It is a type name or a table name.
SOURCESAn array of the source column names of the index. If the index column is multiple column index, the array has two or more source column names.
It is always an empty array for
COLUMN_SCALARandCOLUMN_VECTOR.