[TD-6443]<feature>: Support OpenTSDB HTTP JSON data import format
This commit is contained in:
parent
b60bab7abd
commit
7ceb5fa94e
|
@ -567,6 +567,7 @@ int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs, char **
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//only pick up the first ID value as child table name
|
||||||
cJSON *id = cJSON_GetObjectItem(tags, "ID");
|
cJSON *id = cJSON_GetObjectItem(tags, "ID");
|
||||||
if (id != NULL) {
|
if (id != NULL) {
|
||||||
int32_t idLen = strlen(id->valuestring);
|
int32_t idLen = strlen(id->valuestring);
|
||||||
|
@ -576,8 +577,11 @@ int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs, char **
|
||||||
}
|
}
|
||||||
*childTableName = tcalloc(idLen + 1, sizeof(char));
|
*childTableName = tcalloc(idLen + 1, sizeof(char));
|
||||||
memcpy(*childTableName, id->valuestring, idLen);
|
memcpy(*childTableName, id->valuestring, idLen);
|
||||||
//remove ID from tags list no case sensitive
|
//remove all ID fields from tags list no case sensitive
|
||||||
cJSON_DeleteItemFromObject(tags, "ID");
|
while (id != NULL) {
|
||||||
|
cJSON_DeleteItemFromObject(tags, "ID");
|
||||||
|
id = cJSON_GetObjectItem(tags, "ID");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tagNum = cJSON_GetArraySize(tags);
|
int32_t tagNum = cJSON_GetArraySize(tags);
|
||||||
|
|
Loading…
Reference in New Issue