in

How to set sub table name while using tdengine’s schemaless insert


I know that tdengine support schemaless insert. And there are three line protocols that tdengine supports. The follow is the sample code from 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: %sn", taos_errstr(res));
  }
  taos_free_result(res);
  // close the connection
  taos_close(taos);
  return (code);
}

I know this will create the stable “stg” and create substable for the incoming data record. I want to ask can I control the subtable’s name and how to configure the name?



Source: https://stackoverflow.com/questions/70538438/how-to-set-sub-table-name-while-using-tdengines-schemaless-insert

53 coups, tweener et autres passings improbables : le Top 5 points de l'année 2021 thumbnail

53 coups, tweener et autres passings improbables : le Top 5 points de l’année 2021

Create a platform for visually challenged individuals to make use of their smart phones