* This is an example, this function needs to be implemented in order to parse the json file into a sql statement
char_names[102400]={0};
* Note that you need to create a super table and database before writing data
char_values[102400]={0};
* In this case:
inti=0;
* create database mqttdb;
intcount=cJSON_GetArraySize(jPlayload);
* create table mqttdb.devices(ts timestamp, value bigint) tags(name binary(32), model binary(32), serial binary(16), param binary(16), unit binary(16));
for(;i<count;i++)
*/
{
cJSON*item=cJSON_GetArrayItem(jPlayload,i);
char*mqttConverJsonToSql(char*json,intmaxSize){
if(cJSON_Object==item->type){
// const int32_t maxSize = 10240;
mqttInfo("The item '%s' is not supported",item->string);
char*sql=malloc(maxSize);
}else{
strcat(_names,item->string);
cJSON*root=cJSON_Parse(json);
if(i<count-1){
if(root==NULL){
strcat(_names,",");
mqttError("failed to parse msg, invalid json format");
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 100000
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 100000
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode1 -c mqtt -v 1
system sh/cfg.sh -n dnode1 -c mqttBrokerAddress -v mqtt://test.mosquitto.org:1883/#
system sh/cfg.sh -n dnode1 -c mqttBrokerClientId -v taosmqtt
system sh/exec.sh -n dnode1 -s start
\ No newline at end of file
sql sleep 3000
sql connect
sql create database mqttdb;
sql create table mqttdb.devices(ts timestamp, value bigint) tags(name binary(32), model binary(32), serial binary(16), param binary(16), unit binary(16));