printf("failed to create super table meters, reason:%s\n",taos_errstr(pRes));
return-1;
...
...
@@ -396,7 +408,9 @@ int buildStable(TAOS* pConn, TAOS_RES* pRes){
}
taos_free_result(pRes);
pRes=taos_query(pConn,"create stream meters_summary_s into meters_summary as select _wstart, max(current) as current, groupid, location from meters partition by groupid, location interval(10m)");
pRes=taos_query(pConn,
"create stream meters_summary_s into meters_summary as select _wstart, max(current) as current, "
"groupid, location from meters partition by groupid, location interval(10m)");
if(taos_errno(pRes)!=0){
printf("failed to create super table meters_summary, reason:%s\n",taos_errstr(pRes));
return-1;
...
...
@@ -471,9 +485,9 @@ int32_t init_env() {
}
taos_free_result(pRes);
if(g_conf.subTable){
if(g_conf.subTable){
buildStable(pConn,pRes);
}else{
}else{
buildDatabase(pConn,pRes);
}
...
...
@@ -496,14 +510,14 @@ int32_t create_topic() {
}
taos_free_result(pRes);
if(g_conf.subTable){
if(g_conf.subTable){
pRes=taos_query(pConn,"create topic meters_summary_t1 with meta as stable meters_summary");
if(taos_errno(pRes)!=0){
printf("failed to create topic meters_summary_t1, reason:%s\n",taos_errstr(pRes));
return-1;
}
taos_free_result(pRes);
}else{
}else{
pRes=taos_query(pConn,"create topic topic_db with meta as database abc1");
if(taos_errno(pRes)!=0){
printf("failed to create topic topic_db, reason:%s\n",taos_errstr(pRes));