创建表
curl方式:
echo ‘create table test.student11(dt Date, id UInt16, name String, age UInt16) ENGINE=MergeTree(dt, (id, name), 10)’| curl -XPOST ‘http://localhost:8123/’ -d @-
api方式:
HttpClientUtil.doPostByString(“http://node02:8123/”,“create table test.student11(dt Date, id UInt16, name String, age UInt16) ENGINE=MergeTree(dt, (id, name), 10)’| curl -XPOST 'http://localhost:8123/”);
插入数据
curl方式:
echo “insert into test.student(dt, id, name, age) values (‘2018-06-01’, 12, ‘aaa’, 10)” | curl -XPOST ‘http://localhost:8123/’ -d @-
或者
curl -XPOST ‘http://localhost:8123/’ -d “insert into test.student(dt, id, name, age) values (‘2018-06-01’, 14, ‘aaa’, 10)”
api方式:
HttpClientUtil.doPostByString(“http://node02:8123/”,“insert into test.student(dt, id, name, age) values (‘2018-06-01’, 21, ‘aaa’, 10)”);