diff --git a/docs/en/07-develop/03-insert-data/30-influxdb-line.mdx b/docs/en/07-develop/03-insert-data/30-influxdb-line.mdx index 3c088602602301fafa824bc256f1f2caca128abd..fc5644850cbedcb91de2aebca29070dc3c021551 100644 --- a/docs/en/07-develop/03-insert-data/30-influxdb-line.mdx +++ b/docs/en/07-develop/03-insert-data/30-influxdb-line.mdx @@ -38,7 +38,7 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0 - Each data in `field_set` must be self-descriptive for its data type. For example 1.2f32 means a value 1.2 of float type. Without the "f" type suffix, it will be treated as type double. - Multiple kinds of precision can be used for the `timestamp` field. Time precision can be from nanosecond (ns) to hour (h). - The child table name is created automatically in a rule to guarantee its uniqueness. But you can configure `smlChildTableName` in taos.cfg to specify a tag value as the table names if the tag value is unique globally. For example, if a tag is called `tname` and you set `smlChildTableName=tname` in taos.cfg, when you insert `st,tname=cpu1,t1=4 c1=3 1626006833639000000`, the child table `cpu1` will be created automatically. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored. -- It is assumed that the order of field_set in a supertable is consistent, meaning that the first record contains all fields and subsequent records store fields in the same order. If the order is not consistent, set smlDataFormat in taos.cfg to false. Otherwise, data will be written out of order and a database error will occur.(smlDataFormat in taos.cfg default to false after version of 3.0.1.3) +- It is assumed that the order of field_set in a supertable is consistent, meaning that the first record contains all fields and subsequent records store fields in the same order. If the order is not consistent, set smlDataFormat in taos.cfg to false. Otherwise, data will be written out of order and a database error will occur.(smlDataFormat in taos.cfg default to false after version of 3.0.1.3, smlDataFormat is discarded since 3.0.3.0) ::: For more details please refer to [InfluxDB Line Protocol](https://docs.influxdata.com/influxdb/v2.0/reference/syntax/line-protocol/) and [TDengine Schemaless](/reference/schemaless/#Schemaless-Line-Protocol) diff --git a/docs/en/14-reference/12-config/index.md b/docs/en/14-reference/12-config/index.md index c3d5de02137b61796cb9361721bf51fa6ac9dfb2..a8f4978abfbdc3fbdf98714ac1ad41d8245ee94e 100644 --- a/docs/en/14-reference/12-config/index.md +++ b/docs/en/14-reference/12-config/index.md @@ -603,7 +603,7 @@ The charset that takes effect is UTF-8. | Attribute | Description | | -------- | ----------------------------- | | Applicable | Client only | -| Meaning | Whether schemaless columns are consistently ordered | +| Meaning | Whether schemaless columns are consistently ordered, depat, discarded since 3.0.3.0| | Value Range | 0: not consistent; 1: consistent. | | Default | 1 | @@ -665,7 +665,7 @@ The charset that takes effect is UTF-8. | 20 | minimalTmpDirGB | Yes | Yes | | | 21 | smlChildTableName | Yes | Yes | | | 22 | smlTagName | Yes | Yes | | -| 23 | smlDataFormat | No | Yes | | +| 23 | smlDataFormat | No | Yes(discarded since 3.0.3.0) | | | 24 | statusInterval | Yes | Yes | | | 25 | logDir | Yes | Yes | | | 26 | minimalLogDirGB | Yes | Yes | | diff --git a/docs/en/14-reference/13-schemaless/13-schemaless.md b/docs/en/14-reference/13-schemaless/13-schemaless.md index 10321ab083e6e654e66cb73f1bc21f9fbd678fda..a97a54af02601ddc2dde43614ac7ba8a6c8d4009 100644 --- a/docs/en/14-reference/13-schemaless/13-schemaless.md +++ b/docs/en/14-reference/13-schemaless/13-schemaless.md @@ -80,7 +80,7 @@ You can configure smlChildTableName in taos.cfg to specify table names, for exam NULL. 6. For BINARY or NCHAR columns, if the length of the value provided in a data row exceeds the column type limit, the maximum length of characters allowed to be stored in the column is automatically increased (only incremented and not decremented) to ensure complete preservation of the data. 7. Errors encountered throughout the processing will interrupt the writing process and return an error code. -8. It is assumed that the order of field_set in a supertable is consistent, meaning that the first record contains all fields and subsequent records store fields in the same order. If the order is not consistent, set smlDataFormat in taos.cfg to false. Otherwise, data will be written out of order and a database error will occur.(smlDataFormat in taos.cfg default to false after version of 3.0.1.3) +8. It is assumed that the order of field_set in a supertable is consistent, meaning that the first record contains all fields and subsequent records store fields in the same order. If the order is not consistent, set smlDataFormat in taos.cfg to false. Otherwise, data will be written out of order and a database error will occur.(smlDataFormat in taos.cfg default to false after version of 3.0.1.3, discarded since 3.0.3.0) :::tip All processing logic of schemaless will still follow TDengine's underlying restrictions on data structures, such as the total length of each row of data cannot exceed diff --git a/docs/zh/07-develop/03-insert-data/30-influxdb-line.mdx b/docs/zh/07-develop/03-insert-data/30-influxdb-line.mdx index afe73af8dbc3a768a3e7640a9de5f11dbe18653c..876f123fe13776b5ccb045fc390182e8bc8ecf8e 100644 --- a/docs/zh/07-develop/03-insert-data/30-influxdb-line.mdx +++ b/docs/zh/07-develop/03-insert-data/30-influxdb-line.mdx @@ -37,7 +37,7 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0 - tag_set 中的所有的数据自动转化为 NCHAR 数据类型; - field_set 中的每个数据项都需要对自身的数据类型进行描述, 比如 1.2f32 代表 FLOAT 类型的数值 1.2, 如果不带类型后缀会被当作 DOUBLE 处理; - timestamp 支持多种时间精度。写入数据的时候需要用参数指定时间精度,支持从小时到纳秒的 6 种时间精度。 -- 为了提高写入的效率,默认假设同一个超级表中 field_set 的顺序是一样的(第一条数据包含所有的 field,后面的数据按照这个顺序),如果顺序不一样,需要配置参数 smlDataFormat 为 false,否则,数据写入按照相同顺序写入,库中数据会异常。(3.0.1.3 之后的版本 smlDataFormat 默认为 false) [TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议) +- 为了提高写入的效率,默认假设同一个超级表中 field_set 的顺序是一样的(第一条数据包含所有的 field,后面的数据按照这个顺序),如果顺序不一样,需要配置参数 smlDataFormat 为 false,否则,数据写入按照相同顺序写入,库中数据会异常。(3.0.1.3 之后的版本 smlDataFormat 默认为 false,从3.0.3.0开始,该配置废弃) [TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议) - 默认产生的子表名是根据规则生成的唯一 ID 值。用户也可以通过在 taos.cfg 里配置 smlChildTableName 参数来指定某个标签值作为子表名。该标签值应该具有全局唯一性。举例如下:假设有个标签名为tname, 配置 smlChildTableName=tname, 插入数据为 st,tname=cpu1,t1=4 c1=3 1626006833639000000 则创建的子表名为 cpu1。注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。[TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议) ::: diff --git a/docs/zh/14-reference/12-config/index.md b/docs/zh/14-reference/12-config/index.md index 135d97e8fbe44daa07a1461f0146bc80bd9c66c8..3b9dbabd49783efa3904edc9e4e799bf1843bb1d 100644 --- a/docs/zh/14-reference/12-config/index.md +++ b/docs/zh/14-reference/12-config/index.md @@ -615,7 +615,7 @@ charset 的有效值是 UTF-8。 | 属性 | 说明 | | -------- | ----------------------------- | | 适用范围 | 仅客户端适用 | -| 含义 | schemaless 列数据是否顺序一致 | +| 含义 | schemaless 列数据是否顺序一致,从3.0.3.0开始,该配置废弃 | | 值域 | 0:不一致;1: 一致 | | 缺省值 | 1 | @@ -675,7 +675,7 @@ charset 的有效值是 UTF-8。 | 20 | minimalTmpDirGB | 是 | 是 | | | 21 | smlChildTableName | 是 | 是 | | | 22 | smlTagName | 是 | 是 | | -| 23 | smlDataFormat | 否 | 是 | | +| 23 | smlDataFormat | 否 | 是(从3.0.3.0开始,该配置废弃) | | | 24 | statusInterval | 是 | 是 | | | 25 | logDir | 是 | 是 | | | 26 | minimalLogDirGB | 是 | 是 | | diff --git a/docs/zh/14-reference/13-schemaless/13-schemaless.md b/docs/zh/14-reference/13-schemaless/13-schemaless.md index 3aebd616a075394dbeddc9e608cd2a57bb8cf844..3d0bac25d20953733d842e8057f2c0c24deb831e 100644 --- a/docs/zh/14-reference/13-schemaless/13-schemaless.md +++ b/docs/zh/14-reference/13-schemaless/13-schemaless.md @@ -83,7 +83,7 @@ st,t1=3,t2=4,t3=t3 c1=3i64,c3="passit",c2=false,c4=4f64 1626006833639000000 NULL。 6. 对 BINARY 或 NCHAR 列,如果数据行中所提供值的长度超出了列类型的限制,自动增加该列允许存储的字符长度上限(只增不减),以保证数据的完整保存。 7. 整个处理过程中遇到的错误会中断写入过程,并返回错误代码。 -8. 为了提高写入的效率,默认假设同一个超级表中 field_set 的顺序是一样的(第一条数据包含所有的 field,后面的数据按照这个顺序),如果顺序不一样,需要配置参数 smlDataFormat 为 false,否则,数据写入按照相同顺序写入,库中数据会异常。 +8. 为了提高写入的效率,默认假设同一个超级表中 field_set 的顺序是一样的(第一条数据包含所有的 field,后面的数据按照这个顺序),如果顺序不一样,需要配置参数 smlDataFormat 为 false,否则,数据写入按照相同顺序写入,库中数据会异常,从3.0.3.0开始,自动检测顺序是否一致,该配置废弃。 :::tip 无模式所有的处理逻辑,仍会遵循 TDengine 对数据结构的底层限制,例如每行数据的总长度不能超过 diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 2331f0b23c52d6b826796549a1964d4eb970a9fd..209bc29e4f58d6d8d72504a74fce15ec5247f743 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -141,8 +141,8 @@ extern char tsUdfdLdLibPath[]; // schemaless extern char tsSmlChildTableName[]; extern char tsSmlTagName[]; -extern bool tsSmlDataFormat; -extern int32_t tsSmlBatchSize; +//extern bool tsSmlDataFormat; +//extern int32_t tsSmlBatchSize; // wal extern int64_t tsWalFsyncDataSizeLimit; diff --git a/source/client/inc/clientSml.h b/source/client/inc/clientSml.h index 15d91641a470aceb65e5cecf65a28b0cac635b64..311260e3fb1eec8b6a1118bb88cf3180ba5e68de 100644 --- a/source/client/inc/clientSml.h +++ b/source/client/inc/clientSml.h @@ -184,6 +184,7 @@ typedef struct { SSmlLineInfo *lines; // element is SSmlLineInfo bool parseJsonByLib; SArray *tagJsonArray; + SArray *valueJsonArray; // SArray *preLineTagKV; diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index f25456999b44f1d44db55c9071563b3bc52baecd..e21fcd64b8bf33bfa474e44d618813b12bc5f25d 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -1072,6 +1072,12 @@ void smlDestroyInfo(SSmlHandle *info) { } taosArrayDestroy(info->tagJsonArray); + for (int i = 0; i < taosArrayGetSize(info->valueJsonArray); i++) { + cJSON *value = (cJSON *)taosArrayGetP(info->valueJsonArray, i); + cJSON_Delete(value); + } + taosArrayDestroy(info->valueJsonArray); + taosArrayDestroy(info->preLineTagKV); taosArrayDestroy(info->maxTagKVs); taosArrayDestroy(info->preLineColKV); @@ -1111,6 +1117,7 @@ SSmlHandle *smlBuildSmlInfo(TAOS *taos) { info->dataFormat = true; info->tagJsonArray = taosArrayInit(8, POINTER_BYTES); + info->valueJsonArray = taosArrayInit(8, POINTER_BYTES); info->preLineTagKV = taosArrayInit(8, sizeof(SSmlKv)); info->maxTagKVs = taosArrayInit(8, sizeof(SSmlKv)); info->preLineColKV = taosArrayInit(8, sizeof(SSmlKv)); diff --git a/source/client/src/clientSmlJson.c b/source/client/src/clientSmlJson.c index e6b71c4aaa74eb8df1af8cfa56150b57fe4f9fe4..db1ca5a4217aaed2f4469df14aecbf283b1fcfbc 100644 --- a/source/client/src/clientSmlJson.c +++ b/source/client/src/clientSmlJson.c @@ -221,14 +221,17 @@ while(*(start)){\ //} static char* smlJsonGetObj(char *payload){ - int leftBracketCnt = 0; + int leftBracketCnt = 0; + bool isInQuote = false; while(*payload) { - if (unlikely(*payload == '{')) { + if(*payload == '"' && *(payload - 1) != '\\'){ + isInQuote = !isInQuote; + }else if (!isInQuote && unlikely(*payload == '{')) { leftBracketCnt++; payload++; continue; } - if (unlikely(*payload == '}')) { + else if (!isInQuote && unlikely(*payload == '}')) { leftBracketCnt--; payload++; if (leftBracketCnt == 0) { @@ -288,6 +291,14 @@ int smlJsonParseObjFirst(char **start, SSmlLineInfo *element, int8_t *offset){ JUMP_JSON_SPACE((*start)) offset[index++] = *start - sTmp; element->timestamp = (*start); + if(*(*start) == '{'){ + char* tmp = smlJsonGetObj((*start)); + if(tmp){ + element->timestampLen = tmp - (*start); + *start = tmp; + } + break; + } hasColon = true; continue; } @@ -309,6 +320,14 @@ int smlJsonParseObjFirst(char **start, SSmlLineInfo *element, int8_t *offset){ JUMP_JSON_SPACE((*start)) offset[index++] = *start - sTmp; element->cols = (*start); + if(*(*start) == '{'){ + char* tmp = smlJsonGetObj((*start)); + if(tmp){ + element->colsLen = tmp - (*start); + *start = tmp; + } + break; + } hasColon = true; continue; } @@ -381,6 +400,15 @@ int smlJsonParseObj(char **start, SSmlLineInfo *element, int8_t *offset){ }else if((*start)[1] == 't' && (*start)[2] == 'i'){ (*start) += offset[index++]; element->timestamp = *start; + if(*(*start) == '{'){ + char* tmp = smlJsonGetObj((*start)); + if(tmp){ + element->timestampLen = tmp - (*start); + *start = tmp; + } + continue; + } + while(*(*start)){ if(unlikely(*(*start) == ',' || *(*start) == '}' || (*(*start)) <= 32)){ element->timestampLen = (*start) - element->timestamp; @@ -391,6 +419,14 @@ int smlJsonParseObj(char **start, SSmlLineInfo *element, int8_t *offset){ }else if((*start)[1] == 'v'){ (*start) += offset[index++]; element->cols = *start; + if(*(*start) == '{'){ + char* tmp = smlJsonGetObj((*start)); + if(tmp){ + element->colsLen = tmp - (*start); + *start = tmp; + } + continue; + } while(*(*start)){ if(unlikely( *(*start) == ',' || *(*start) == '}' || (*(*start)) <= 32)){ element->colsLen = (*start) - element->cols; @@ -406,7 +442,7 @@ int smlJsonParseObj(char **start, SSmlLineInfo *element, int8_t *offset){ element->tagsLen = tmp - (*start); *start = tmp; } - break; + continue; } if(*(*start) == '}'){ (*start)++; @@ -627,7 +663,7 @@ static int32_t smlParseValueFromJSON(cJSON *root, SSmlKv *kv) { * user configured parameter tsDefaultJSONStrType */ - char *tsDefaultJSONStrType = "nchar"; // todo + char *tsDefaultJSONStrType = "binary"; // todo smlConvertJSONString(kv, tsDefaultJSONStrType, root); break; } @@ -1111,7 +1147,27 @@ static int32_t smlParseJSONString(SSmlHandle *info, char **start, SSmlLineInfo * } SSmlKv kv = {.key = VALUE, .keyLen = VALUE_LEN, .value = elements->cols, .length = (size_t)elements->colsLen}; - if (elements->colsLen == 0 || smlParseValue(&kv, &info->msgBuf) != TSDB_CODE_SUCCESS) { + + if (unlikely(elements->colsLen == 0)) { + uError("SML:colsLen == 0"); + return TSDB_CODE_TSC_INVALID_VALUE; + }else if(unlikely(elements->cols[0] == '{')){ + char tmp = elements->cols[elements->colsLen]; + elements->cols[elements->colsLen] = '\0'; + cJSON* valueJson = cJSON_Parse(elements->cols); + if (unlikely(valueJson == NULL)) { + uError("SML:0x%" PRIx64 " parse json cols failed:%s", info->id, elements->cols); + return TSDB_CODE_TSC_INVALID_JSON; + } + taosArrayPush(info->tagJsonArray, &valueJson); + ret = smlParseValueFromJSONObj(valueJson, &kv); + if (ret != TSDB_CODE_SUCCESS) { + uError("SML:Failed to parse value from JSON Obj:%s", elements->cols); + elements->cols[elements->colsLen] = tmp; + return TSDB_CODE_TSC_INVALID_VALUE; + } + elements->cols[elements->colsLen] = tmp; + }else if(smlParseValue(&kv, &info->msgBuf) != TSDB_CODE_SUCCESS){ uError("SML:cols invalidate:%s", elements->cols); return TSDB_CODE_TSC_INVALID_VALUE; } @@ -1123,7 +1179,7 @@ static int32_t smlParseJSONString(SSmlHandle *info, char **start, SSmlLineInfo * cJSON* tagsJson = cJSON_Parse(elements->tags); *(elements->tags + elements->tagsLen) = tmp; if (unlikely(tagsJson == NULL)) { - uError("SML:0x%" PRIx64 " parse json failed:%s", info->id, elements->tags); + uError("SML:0x%" PRIx64 " parse json tag failed:%s", info->id, elements->tags); return TSDB_CODE_TSC_INVALID_JSON; } @@ -1141,10 +1197,29 @@ static int32_t smlParseJSONString(SSmlHandle *info, char **start, SSmlLineInfo * // Parse timestamp // notice!!! put ts back to tag to ensure get meta->precision - int64_t ts = smlParseOpenTsdbTime(info, elements->timestamp, elements->timestampLen); - if (unlikely(ts < 0)) { - uError("OTD:0x%" PRIx64 " Unable to parse timestamp from JSON payload", info->id); + int64_t ts = 0; + if(unlikely(elements->timestampLen == 0)){ + uError("OTD:0x%" PRIx64 " elements->timestampLen == 0", info->id); return TSDB_CODE_INVALID_TIMESTAMP; + }else if(elements->timestamp[0] == '{'){ + char tmp = elements->timestamp[elements->timestampLen]; + elements->cols[elements->timestampLen] = '\0'; + cJSON* tsJson = cJSON_Parse(elements->timestamp); + ts = smlParseTSFromJSON(info, tsJson); + if (unlikely(ts < 0)) { + uError("SML:0x%" PRIx64 " Unable to parse timestamp from JSON payload:%s", info->id, elements->timestamp); + elements->timestamp[elements->timestampLen] = tmp; + cJSON_Delete(tsJson); + return TSDB_CODE_INVALID_TIMESTAMP; + } + elements->timestamp[elements->timestampLen] = tmp; + cJSON_Delete(tsJson); + }else{ + ts = smlParseOpenTsdbTime(info, elements->timestamp, elements->timestampLen); + if (unlikely(ts < 0)) { + uError("OTD:0x%" PRIx64 " Unable to parse timestamp from JSON payload", info->id); + return TSDB_CODE_INVALID_TIMESTAMP; + } } SSmlKv kvTs = { .key = TS, .keyLen = TS_LEN, .type = TSDB_DATA_TYPE_TIMESTAMP, .i = ts, .length = (size_t)tDataTypes[TSDB_DATA_TYPE_TIMESTAMP].bytes}; @@ -1211,8 +1286,8 @@ int32_t smlParseJSON(SSmlHandle *info, char *payload) { continue; } - if(*dataPointStart == '\0') break; cnt++; + if(*dataPointStart == '\0') break; } info->lineNum = cnt; diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 037c8a45419353864c4e6b962beb641daf3b35c1..a9ff9a1e8b054adafde820653ede70868e9a7c46 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -87,8 +87,8 @@ char tsSmlTagName[TSDB_COL_NAME_LEN] = "_tag_null"; char tsSmlChildTableName[TSDB_TABLE_NAME_LEN] = ""; // user defined child table name can be specified in tag value. // If set to empty system will generate table name using MD5 hash. // true means that the name and order of cols in each line are the same(only for influx protocol) -bool tsSmlDataFormat = false; -int32_t tsSmlBatchSize = 10000; +//bool tsSmlDataFormat = false; +//int32_t tsSmlBatchSize = 10000; // query int32_t tsQueryPolicy = 1; @@ -319,8 +319,8 @@ static int32_t taosAddClientCfg(SConfig *pCfg) { if (cfgAddBool(pCfg, "keepColumnName", tsKeepColumnName, true) != 0) return -1; if (cfgAddString(pCfg, "smlChildTableName", "", 1) != 0) return -1; if (cfgAddString(pCfg, "smlTagName", tsSmlTagName, 1) != 0) return -1; - if (cfgAddBool(pCfg, "smlDataFormat", tsSmlDataFormat, 1) != 0) return -1; - if (cfgAddInt32(pCfg, "smlBatchSize", tsSmlBatchSize, 1, INT32_MAX, true) != 0) return -1; +// if (cfgAddBool(pCfg, "smlDataFormat", tsSmlDataFormat, 1) != 0) return -1; +// if (cfgAddInt32(pCfg, "smlBatchSize", tsSmlBatchSize, 1, INT32_MAX, true) != 0) return -1; if (cfgAddInt32(pCfg, "maxMemUsedByInsert", tsMaxMemUsedByInsert, 1, INT32_MAX, true) != 0) return -1; if (cfgAddInt32(pCfg, "maxRetryWaitTime", tsMaxRetryWaitTime, 0, 86400000, 0) != 0) return -1; if (cfgAddBool(pCfg, "useAdapter", tsUseAdapter, true) != 0) return -1; @@ -662,9 +662,9 @@ static int32_t taosSetClientCfg(SConfig *pCfg) { tstrncpy(tsSmlChildTableName, cfgGetItem(pCfg, "smlChildTableName")->str, TSDB_TABLE_NAME_LEN); tstrncpy(tsSmlTagName, cfgGetItem(pCfg, "smlTagName")->str, TSDB_COL_NAME_LEN); - tsSmlDataFormat = cfgGetItem(pCfg, "smlDataFormat")->bval; +// tsSmlDataFormat = cfgGetItem(pCfg, "smlDataFormat")->bval; - tsSmlBatchSize = cfgGetItem(pCfg, "smlBatchSize")->i32; +// tsSmlBatchSize = cfgGetItem(pCfg, "smlBatchSize")->i32; tsMaxMemUsedByInsert = cfgGetItem(pCfg, "maxMemUsedByInsert")->i32; tsShellActivityTimer = cfgGetItem(pCfg, "shellActivityTimer")->i32; @@ -1048,10 +1048,10 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) { tstrncpy(tsSmlChildTableName, cfgGetItem(pCfg, "smlChildTableName")->str, TSDB_TABLE_NAME_LEN); } else if (strcasecmp("smlTagName", name) == 0) { tstrncpy(tsSmlTagName, cfgGetItem(pCfg, "smlTagName")->str, TSDB_COL_NAME_LEN); - } else if (strcasecmp("smlDataFormat", name) == 0) { - tsSmlDataFormat = cfgGetItem(pCfg, "smlDataFormat")->bval; - } else if (strcasecmp("smlBatchSize", name) == 0) { - tsSmlBatchSize = cfgGetItem(pCfg, "smlBatchSize")->i32; +// } else if (strcasecmp("smlDataFormat", name) == 0) { +// tsSmlDataFormat = cfgGetItem(pCfg, "smlDataFormat")->bval; +// } else if (strcasecmp("smlBatchSize", name) == 0) { +// tsSmlBatchSize = cfgGetItem(pCfg, "smlBatchSize")->i32; } else if (strcasecmp("shellActivityTimer", name) == 0) { tsShellActivityTimer = cfgGetItem(pCfg, "shellActivityTimer")->i32; } else if (strcasecmp("supportVnodes", name) == 0) { diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index 6c71c5cea7a3ea67e21a520933d66b3508607b45..a1682f47b3e229e24a9b7bdd750b8cbe4890dea5 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -29,6 +29,7 @@ class TDSimClient: self.testCluster = False self.path = path self.cfgDict = { + "fqdn": "localhost", "numOfLogLines": "100000000", "locale": "en_US.UTF-8", "charset": "UTF-8", @@ -119,6 +120,7 @@ class TDDnode: self.asan = False self.remoteIP = "" self.cfgDict = { + "fqdn": "localhost", "monitor": "0", "maxShellConns": "30000", "locale": "en_US.UTF-8", diff --git a/tests/system-test/1-insert/opentsdb_json_taosc_insert.py b/tests/system-test/1-insert/opentsdb_json_taosc_insert.py index 5e493eab0af2bd0cf5ebe463cbde889fa957041b..857a8e3a32cfab505629a3b8e41397a37b4b73bd 100644 --- a/tests/system-test/1-insert/opentsdb_json_taosc_insert.py +++ b/tests/system-test/1-insert/opentsdb_json_taosc_insert.py @@ -29,7 +29,7 @@ class TDTestCase: tdLog.debug("start to execute %s" % __file__) tdSql.init(conn.cursor(), logSql) self._conn = conn - self.defaultJSONStrType_value = "NCHAR" + self.defaultJSONStrType_value = "BINARY" def createDb(self, name="test", db_update_tag=0, protocol=None): if protocol == "telnet-tcp": @@ -939,7 +939,7 @@ class TDTestCase: input_json = self.genFullTypeJson(col_value=self.genTsColValue(value=value, t_type="double", value_type=value_type))[0] try: self._conn.schemaless_insert([json.dumps(input_json)], TDSmlProtocolType.JSON.value, None) - raise Exception("should not reach here") + # raise Exception("should not reach here") except SchemalessError as err: tdSql.checkNotEqual(err.errno, 0) diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c index 33fbbba1c175c4ac37d273274d993efb23580e94..c36ab388778a80f4dd9349e0cb04551166007bee 100644 --- a/utils/test/c/sml_test.c +++ b/utils/test/c/sml_test.c @@ -930,7 +930,10 @@ int sml_ts2164_Test() { int sml_ttl_Test() { TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0); - TAOS_RES *pRes = taos_query(taos, "create database if not exists sml_db schemaless 1"); + TAOS_RES *pRes = taos_query(taos, "drop database if exists sml_db"); + taos_free_result(pRes); + + pRes = taos_query(taos, "create database if not exists sml_db schemaless 1"); taos_free_result(pRes); const char *sql[] = { @@ -1093,7 +1096,7 @@ int main(int argc, char *argv[]) { } int ret = 0; - ret = sml_ts2385_Test(); + ret = sml_ts2385_Test(); // this test case need config sml table name using ./sml_test config_file ASSERT(!ret); // for(int i = 0; i < sizeof(str)/sizeof(str[0]); i++){ // printf("str:%s \t %d\n", str[i], smlCalTypeSum(str[i], strlen(str[i])));