提交 2220147e 编写于 作者: G Ganlin Zhao

remove conversion OpenTSDB dot to underscore logic

上级 8f512294
...@@ -58,12 +58,7 @@ static int32_t parseTelnetMetric(TAOS_SML_DATA_POINT *pSml, const char **index, ...@@ -58,12 +58,7 @@ static int32_t parseTelnetMetric(TAOS_SML_DATA_POINT *pSml, const char **index,
break; break;
} }
//convert dot to underscore for now, will be removed once dot is allowed in tbname. pSml->stableName[len] = *cur;
if (*cur == '.') {
pSml->stableName[len] = '_';
} else {
pSml->stableName[len] = *cur;
}
cur++; cur++;
len++; len++;
...@@ -461,13 +456,6 @@ int32_t parseMetricFromJSON(cJSON *root, TAOS_SML_DATA_POINT* pSml, SSmlLinesInf ...@@ -461,13 +456,6 @@ int32_t parseMetricFromJSON(cJSON *root, TAOS_SML_DATA_POINT* pSml, SSmlLinesInf
return TSDB_CODE_TSC_INVALID_JSON; return TSDB_CODE_TSC_INVALID_JSON;
} }
//convert dot to underscore for now, will be removed once dot is allowed in tbname.
for (int i = 0; i < strlen(metric->valuestring); ++i) {
if (metric->valuestring[i] == '.') {
metric->valuestring[i] = '_';
}
}
tstrncpy(pSml->stableName, metric->valuestring, stableLen + 1); tstrncpy(pSml->stableName, metric->valuestring, stableLen + 1);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
......
...@@ -35,7 +35,7 @@ class TDTestCase: ...@@ -35,7 +35,7 @@ class TDTestCase:
print("============= step0 : test metric ================") print("============= step0 : test metric ================")
payload = ''' payload = '''
{ {
"metric": ".stb.0.", "metric": "`.stb.0.`",
"timestamp": 1626006833610123, "timestamp": 1626006833610123,
"value": 10, "value": 10,
"tags": { "tags": {
...@@ -49,7 +49,7 @@ class TDTestCase: ...@@ -49,7 +49,7 @@ class TDTestCase:
code = self._conn.insert_json_payload(payload) code = self._conn.insert_json_payload(payload)
print("insert_json_payload result {}".format(code)) print("insert_json_payload result {}".format(code))
tdSql.query("describe _stb_0_") tdSql.query("describe `.stb.0.`")
tdSql.checkRows(6) tdSql.checkRows(6)
### metric value ### ### metric value ###
......
...@@ -36,7 +36,7 @@ class TDTestCase: ...@@ -36,7 +36,7 @@ class TDTestCase:
"stb0_0 1626006833639000000ns 4i8 host=\"host0\" interface=\"eth0\"", "stb0_0 1626006833639000000ns 4i8 host=\"host0\" interface=\"eth0\"",
"stb0_1 1626006833639000000ns 4i8 host=\"host0\" interface=\"eth0\"", "stb0_1 1626006833639000000ns 4i8 host=\"host0\" interface=\"eth0\"",
"stb0_2 1626006833639000000ns 4i8 host=\"host0\" interface=\"eth0\"", "stb0_2 1626006833639000000ns 4i8 host=\"host0\" interface=\"eth0\"",
".stb0.3. 1626006833639000000ns 4i8 host=\"host0\" interface=\"eth0\"", "`.stb0.3.` 1626006833639000000ns 4i8 host=\"host0\" interface=\"eth0\"",
] ]
code = self._conn.insert_telnet_lines(lines0) code = self._conn.insert_telnet_lines(lines0)
...@@ -54,7 +54,7 @@ class TDTestCase: ...@@ -54,7 +54,7 @@ class TDTestCase:
tdSql.query("describe stb0_2") tdSql.query("describe stb0_2")
tdSql.checkRows(4) tdSql.checkRows(4)
tdSql.query("describe _stb0_3_") tdSql.query("describe `.stb0.3.`")
tdSql.checkRows(4) tdSql.checkRows(4)
### timestamp ### ### timestamp ###
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册