# Tables management

The eKuiper table command line tools allows you to manage the tables, such as create, describe, show and drop table definitions.

# create a table

The command is used for creating a table. For more detailed information of table definition, please refer to tables.

create table $table_name $table_def | create table -f $table_def_file
1
  • Specify the table definition in command line.

Sample:

# bin/kuiper create table my_table '(id bigint, name string, score float) WITH ( datasource = "lookup.json", FORMAT = "json", KEY = "id");'
table my_table created
1
2

The command create a table named my_table.

  • Specify the table definition in file. If the table is complex, or the table is already wrote in text files with well organized formats, you can just specify the table definition through -f option.

Sample:

# bin/kuiper create table -f /tmp/my_table.txt
table my_table created
1
2

Below is the contents of my_table.txt.

my_table(id bigint, name string, score float)
    WITH ( datasource = "lookup.json", FORMAT = "json", KEY = "id");
1
2

# show tables

The command is used for displaying all of tables defined in the server.

show tables
1

Sample:

# bin/kuiper show tables
my_table
1
2

# describe a table

The command is used for print the detailed definition of table.

describe table $table_name
1

Sample:

# bin/kuiper describe table my_table
Fields
--------------------------------------------------------------------------------
id	bigint
name	string
score	float

FORMAT: json
KEY: id
DATASOURCE: lookup.json
1
2
3
4
5
6
7
8
9
10

Note: eKuiper do not support query table data by cli. Users need join the table with a stream and check the result

# drop a table

The command is used for drop the table definition.

drop table $table_name
1

Sample:

# bin/kuiper drop table my_table
table my_table dropped
1
2