创建表
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)”);
最后
以上就是阳光面包最近收集整理的关于clickhouse的http api与curl命令操作的全部内容,更多相关clickhouse的http内容请搜索靠谱客的其他文章。
发表评论 取消回复