diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 111241cf03a9da14f4f62c47206b8a990a6a529b..2a4ef565dd1c6b6742446adee2daf953665b99e5 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -128,6 +128,7 @@ extern bool tsStartUdfd; // schemaless extern char tsSmlChildTableName[]; +extern char tsSmlTagName[]; extern bool tsSmlDataFormat; // internal diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 61282ae76a4ec00f5014dc942368f1558ea407e0..8b2f47b2958270b37631966808619f0a80089edc 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -63,10 +63,6 @@ for (int i = 1; i < keyLen; ++i) { \ #define TS "_ts" #define TS_LEN 3 -#define TAG "_tag" -#define TAG_LEN 4 -#define TAG_VALUE "NULL" -#define TAG_VALUE_LEN 4 #define VALUE "value" #define VALUE_LEN 5 @@ -402,7 +398,7 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) { } if(taosArrayGetSize(cols) == 0){ outBytes = snprintf(pos, freeBytes,"`%s` %s(%d)", - TAG, tDataTypes[TSDB_DATA_TYPE_NCHAR].name, CHAR_SAVE_LENGTH); + tsSmlTagName, tDataTypes[TSDB_DATA_TYPE_NCHAR].name, CHAR_SAVE_LENGTH); pos += outBytes; freeBytes -= outBytes; *pos = ','; ++pos; --freeBytes; } diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index d74d5a4d4e731cdf1cec4d3e61b2d30a33b467c0..bd7a04c991b21cd9709ad8b529fac442180a3c68 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -78,6 +78,7 @@ char tsTelemServer[TSDB_FQDN_LEN] = "telemetry.taosdata.com"; uint16_t tsTelemPort = 80; // schemaless +char tsSmlTagName[TSDB_COL_NAME_LEN] = "__tag"; 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. bool tsSmlDataFormat = true; // true means that the name and order of cols in each line are the same(only for influx protocol) @@ -522,6 +523,7 @@ 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; tsShellActivityTimer = cfgGetItem(pCfg, "shellActivityTimer")->i32;