The eKuiper table command line tools allows you to manage the tables, such as create, describe, show and drop table definitions.
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
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
The command create a table named my_table
.
-f
option.Sample:
# bin/kuiper create table -f /tmp/my_table.txt
table my_table created
Below is the contents of my_table.txt
.
my_table(id bigint, name string, score float)
WITH ( datasource = "lookup.json", FORMAT = "json", KEY = "id");
The command is used for displaying all of tables defined in the server.
show tables
Sample:
# bin/kuiper show tables
my_table
The command is used for print the detailed definition of table.
describe table $table_name
Sample:
# bin/kuiper describe table my_table
Fields
--------------------------------------------------------------------------------
id bigint
name string
score float
FORMAT: json
KEY: id
DATASOURCE: lookup.json
The command is used for drop the table definition.
drop table $table_name
Sample:
# bin/kuiper drop table my_table
table my_table dropped