【问题标题】:How to set sub table name while using tdengine's schemaless insert如何在使用 tdengine 的无模式插入时设置子表名
【发布时间】:2022-06-28 14:32:43
【问题描述】:

我知道 tdengine 支持无模式插入。 tdengine 支持三种线路协议。以下是来自taosdata's website schemaless chapeter 的示例代码。

#include <stdlib.h>
#include <stdio.h>
#include <taos.h>
int main() {
  const char* host = "127.0.0.1";
  const char* user = "root";
  const char* passwd = "taosdata";
  // connect to server
  TAOS* taos = taos_connect(host, user, passwd, "test", 0);
  // prepare the line string
  char* lines1[] = {
      "stg,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000",
      "stg,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64 1626006833641000000"
  };
  // schema-less insert
  TAOS_RES* res = taos_schemaless_insert(taos, lines1, 2, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS);
  if (taos_errno(res) != 0) {
    printf("failed to insert schema-less data, reason: %s\n", taos_errstr(res));
  }
  taos_free_result(res);
  // close the connection
  taos_close(taos);
  return (code);
}

我知道这将创建稳定的“stg”并为传入的数据记录创建子稳定。我想问一下子表的名字可以控制吗?如何配置?

【问题讨论】:

    标签: tdengine


    【解决方案1】:

    不,您不能在 TDengine 数据库中配置子表名称 子表名的生成方式请参考此链接:https://docs.tdengine.com/reference/schemaless/#main-processing-logic-for-schemaless-writing

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-23
      • 2010-09-19
      • 2019-11-11
      • 1970-01-01
      • 1970-01-01
      • 2011-04-25
      相关资源
      最近更新 更多