dataformatTest.cpp 15.4 KB
Newer Older
C
Cary Xu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#include <gtest/gtest.h>

#include <taoserror.h>
#include <tdataformat.h>
#include <tglobal.h>
#include <tmsg.h>
#include <iostream>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wwrite-strings"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"

#define NONE_CSTR "no"
#define NULL_CSTR "nu"
#define NONE_LEN  2
#define NULL_LEN  2
const static int16_t MAX_COLS = 14;

int main(int argc, char **argv) {
  testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}

// ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 binary(10), c6 nchar(10), c7 tinyint, c8 smallint, c9 bool
STSchema *genSTSchema(int16_t nCols) {
  EXPECT_LE(nCols, MAX_COLS);
  SSchema *pSchema = (SSchema *)taosMemoryCalloc(nCols, sizeof(SSchema));
  EXPECT_NE(pSchema, nullptr);

  for (int16_t i = 0; i < nCols; ++i) {
    pSchema[i].colId = PRIMARYKEY_TIMESTAMP_COL_ID + i;
    char colName[TSDB_COL_NAME_LEN] = {0};
    snprintf(colName, TSDB_COL_NAME_LEN, "c%" PRIi16, i);
    strncpy(pSchema[i].name, colName, TSDB_COL_NAME_LEN);

    switch (i) {
      case 0: {
C
Cary Xu 已提交
55 56
        pSchema[i].type = TSDB_DATA_TYPE_TIMESTAMP;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
57 58
      } break;
      case 1: {
C
Cary Xu 已提交
59 60
        pSchema[i].type = TSDB_DATA_TYPE_INT;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
61 62 63
        ;
      } break;
      case 2: {
C
Cary Xu 已提交
64 65
        pSchema[i].type = TSDB_DATA_TYPE_BIGINT;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
66 67
      } break;
      case 3: {
C
Cary Xu 已提交
68 69
        pSchema[i].type = TSDB_DATA_TYPE_FLOAT;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
70 71
      } break;
      case 4: {
C
Cary Xu 已提交
72 73
        pSchema[i].type = TSDB_DATA_TYPE_DOUBLE;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
74 75
      } break;
      case 5: {
C
Cary Xu 已提交
76 77
        pSchema[i].type = TSDB_DATA_TYPE_BINARY;
        pSchema[i].bytes = 12;
C
Cary Xu 已提交
78 79
      } break;
      case 6: {
C
Cary Xu 已提交
80 81
        pSchema[i].type = TSDB_DATA_TYPE_NCHAR;
        pSchema[i].bytes = 42;
C
Cary Xu 已提交
82 83
      } break;
      case 7: {
C
Cary Xu 已提交
84 85
        pSchema[i].type = TSDB_DATA_TYPE_TINYINT;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
86 87
      } break;
      case 8: {
C
Cary Xu 已提交
88 89
        pSchema[i].type = TSDB_DATA_TYPE_SMALLINT;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
90 91
      } break;
      case 9: {
C
Cary Xu 已提交
92 93
        pSchema[i].type = TSDB_DATA_TYPE_BOOL;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
94 95
      } break;
      case 10: {
C
Cary Xu 已提交
96 97
        pSchema[i].type = TSDB_DATA_TYPE_UTINYINT;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
98 99
      } break;
      case 11: {
C
Cary Xu 已提交
100 101
        pSchema[i].type = TSDB_DATA_TYPE_USMALLINT;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
102 103
      } break;
      case 12: {
C
Cary Xu 已提交
104 105
        pSchema[i].type = TSDB_DATA_TYPE_UINT;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
106 107
      } break;
      case 13: {
C
Cary Xu 已提交
108 109
        pSchema[i].type = TSDB_DATA_TYPE_UBIGINT;
        pSchema[i].bytes = TYPE_BYTES[pSchema[i].type];
C
Cary Xu 已提交
110 111 112 113 114 115 116 117 118
      } break;

      default:
        ASSERT(0);
        break;
    }
  }

  STSchema *pResult = NULL;
C
Cary Xu 已提交
119
  pResult = tdGetSTSChemaFromSSChema(pSchema, nCols, 1);
C
Cary Xu 已提交
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135

  taosMemoryFree(pSchema);
  return pResult;
}

// ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 binary(10), c6 nchar(10), c7 tinyint, c8 smallint, c9 bool
static int32_t genTestData(const char **data, int16_t nCols, SArray **pArray) {
  if (!(*pArray)) {
    *pArray = taosArrayInit(nCols, sizeof(SColVal));
    if (!(*pArray)) return -1;
  }

  for (int16_t i = 0; i < nCols; ++i) {
    SColVal colVal = {0};
    colVal.cid = PRIMARYKEY_TIMESTAMP_COL_ID + i;
    if (strncasecmp(data[i], NONE_CSTR, NONE_LEN) == 0) {
136
      colVal.flag = CV_FLAG_NONE;
C
Cary Xu 已提交
137 138 139
      taosArrayPush(*pArray, &colVal);
      continue;
    } else if (strncasecmp(data[i], NULL_CSTR, NULL_LEN) == 0) {
140
      colVal.flag = CV_FLAG_NULL;
C
Cary Xu 已提交
141 142 143 144 145 146 147 148
      taosArrayPush(*pArray, &colVal);
      continue;
    }

    switch (i) {
      case 0:
        sscanf(data[i], "%" PRIi64, &colVal.value.ts);
        break;
C
Cary Xu 已提交
149
      case 1:
C
Cary Xu 已提交
150
        sscanf(data[i], "%" PRIi32, &colVal.value.i32);
C
Cary Xu 已提交
151
        break;
C
Cary Xu 已提交
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
      case 2:
        sscanf(data[i], "%" PRIi64, &colVal.value.i64);
        break;
      case 3:
        sscanf(data[i], "%f", &colVal.value.f);
        break;
      case 4:
        sscanf(data[i], "%lf", &colVal.value.d);
        break;
      case 5: {
        int16_t dataLen = strlen(data[i]) + 1;
        colVal.value.nData = dataLen < 10 ? dataLen : 10;
        colVal.value.pData = (uint8_t *)data[i];
      } break;
      case 6: {
        int16_t dataLen = strlen(data[i]) + 1;
        colVal.value.nData = dataLen < 40 ? dataLen : 40;
        colVal.value.pData = (uint8_t *)data[i];  // just for test, not real nchar
      } break;
      case 7:
      case 9: {
        int32_t d8;
        sscanf(data[i], "%" PRId32, &d8);
        colVal.value.i8 = (int8_t)d8;
      } break;
      case 8: {
        int32_t d16;
        sscanf(data[i], "%" PRId32, &d16);
        colVal.value.i16 = (int16_t)d16;
      } break;
      case 10: {
        uint32_t u8;
        sscanf(data[i], "%" PRId32, &u8);
        colVal.value.u8 = (uint8_t)u8;
      } break;
      case 11: {
        uint32_t u16;
        sscanf(data[i], "%" PRId32, &u16);
        colVal.value.u16 = (uint16_t)u16;
      } break;
      case 12: {
        sscanf(data[i], "%" PRIu32, &colVal.value.u32);
      } break;
      case 13: {
        sscanf(data[i], "%" PRIu64, &colVal.value.u64);
      } break;
      default:
        ASSERT(0);
    }
    taosArrayPush(*pArray, &colVal);
  }
  return 0;
}

int32_t debugPrintSColVal(SColVal *cv, int8_t type) {
207
  if (COL_VAL_IS_NONE(cv)) {
C
Cary Xu 已提交
208 209 210
    printf("None ");
    return 0;
  }
211
  if (COL_VAL_IS_NULL(cv)) {
C
Cary Xu 已提交
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
    printf("Null ");
    return 0;
  }
  switch (type) {
    case TSDB_DATA_TYPE_BOOL:
      printf("%s ", cv->value.i8 == 0 ? "false" : "true");
      break;
    case TSDB_DATA_TYPE_TINYINT:
      printf("%" PRIi8 " ", cv->value.i8);
      break;
    case TSDB_DATA_TYPE_SMALLINT:
      printf("%" PRIi16 " ", cv->value.i16);
      break;
    case TSDB_DATA_TYPE_INT:
      printf("%" PRIi32 " ", cv->value.i32);
      break;
    case TSDB_DATA_TYPE_BIGINT:
      printf("%" PRIi64 " ", cv->value.i64);
      break;
    case TSDB_DATA_TYPE_FLOAT:
      printf("%f ", cv->value.f);
      break;
    case TSDB_DATA_TYPE_DOUBLE:
      printf("%lf ", cv->value.d);
      break;
    case TSDB_DATA_TYPE_VARCHAR: {
      char tv[15] = {0};
      snprintf(tv, 15, "%s", cv->value.pData);
      printf("%s ", tv);
    } break;
    case TSDB_DATA_TYPE_TIMESTAMP:
      printf("%" PRIi64 " ", cv->value.i64);
      break;
    case TSDB_DATA_TYPE_NCHAR: {
      char tv[15] = {0};
      snprintf(tv, 15, "%s", cv->value.pData);
      printf("%s ", tv);
    } break;
    case TSDB_DATA_TYPE_UTINYINT:
      printf("%" PRIu8 " ", cv->value.u8);
      break;
    case TSDB_DATA_TYPE_USMALLINT:
      printf("%" PRIu16 " ", cv->value.u16);
      break;
    case TSDB_DATA_TYPE_UINT:
      printf("%" PRIu32 " ", cv->value.u32);
      break;
    case TSDB_DATA_TYPE_UBIGINT:
      printf("%" PRIu64 " ", cv->value.u64);
      break;
    case TSDB_DATA_TYPE_JSON:
      printf("JSON ");
      break;
    case TSDB_DATA_TYPE_VARBINARY:
      printf("VARBIN ");
      break;
    case TSDB_DATA_TYPE_DECIMAL:
      printf("DECIMAL ");
      break;
    case TSDB_DATA_TYPE_BLOB:
      printf("BLOB ");
      break;
    case TSDB_DATA_TYPE_MEDIUMBLOB:
      printf("MedBLOB ");
      break;
    case TSDB_DATA_TYPE_MAX:
      printf("UNDEF ");
      break;
    default:
      printf("UNDEF ");
      break;
  }
  return 0;
}

void debugPrintTSRow(STSRow2 *row, STSchema *pTSchema, const char *tags, int32_t ln) {
H
Hongze Cheng 已提交
288
  // printf("%s:%d %s:v%d:%d ", tags, ln, (row->flags & 0xf0) ? "KV" : "TP", row->sver, row->nData);
H
Hongze Cheng 已提交
289
  for (int16_t i = 0; i < pTSchema->numOfCols; ++i) {
C
Cary Xu 已提交
290 291 292 293 294 295 296 297 298 299 300
    SColVal cv = {0};
    tTSRowGet(row, pTSchema, i, &cv);
    debugPrintSColVal(&cv, pTSchema->columns[i].type);
  }
  printf("\n");
  fflush(stdout);
}

static int32_t checkSColVal(const char *rawVal, SColVal *cv, int8_t type) {
  ASSERT(rawVal);

301
  if (COL_VAL_IS_NONE(cv)) {
C
Cary Xu 已提交
302 303 304
    EXPECT_STRCASEEQ(rawVal, NONE_CSTR);
    return 0;
  }
305
  if (COL_VAL_IS_NULL(cv)) {
C
Cary Xu 已提交
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395
    EXPECT_STRCASEEQ(rawVal, NULL_CSTR);
    return 0;
  }

  SValue rawSVal = {0};
  switch (type) {
    case TSDB_DATA_TYPE_BOOL:
    case TSDB_DATA_TYPE_TINYINT: {
      int32_t d8;
      sscanf(rawVal, "%" PRId32, &d8);
      EXPECT_EQ(cv->value.i8, (int8_t)d8);
    } break;
    case TSDB_DATA_TYPE_SMALLINT: {
      int32_t d16;
      sscanf(rawVal, "%" PRId32, &d16);
      EXPECT_EQ(cv->value.i16, (int16_t)d16);
    } break;
    case TSDB_DATA_TYPE_INT: {
      sscanf(rawVal, "%" PRId32, &rawSVal.i32);
      EXPECT_EQ(cv->value.i32, rawSVal.i32);
    } break;
    case TSDB_DATA_TYPE_BIGINT: {
      sscanf(rawVal, "%" PRIi64, &rawSVal.i64);
      EXPECT_EQ(cv->value.i64, rawSVal.i64);
    } break;
    case TSDB_DATA_TYPE_FLOAT: {
      sscanf(rawVal, "%f", &rawSVal.f);
      EXPECT_FLOAT_EQ(cv->value.f, rawSVal.f);
    } break;
    case TSDB_DATA_TYPE_DOUBLE: {
      sscanf(rawVal, "%lf", &rawSVal.d);
      EXPECT_DOUBLE_EQ(cv->value.d, rawSVal.d);
    } break;
    case TSDB_DATA_TYPE_VARCHAR: {
      EXPECT_STRCASEEQ(rawVal, (const char *)cv->value.pData);
    } break;
    case TSDB_DATA_TYPE_TIMESTAMP: {
      sscanf(rawVal, "%" PRIi64, &rawSVal.ts);
      EXPECT_DOUBLE_EQ(cv->value.ts, rawSVal.ts);
    } break;
    case TSDB_DATA_TYPE_NCHAR: {
      EXPECT_STRCASEEQ(rawVal, (const char *)cv->value.pData);  // informal nchar comparsion
    } break;
    case TSDB_DATA_TYPE_UTINYINT: {
      uint32_t u8;
      sscanf(rawVal, "%" PRIu32, &u8);
      EXPECT_EQ(cv->value.u8, (uint8_t)u8);
    } break;
    case TSDB_DATA_TYPE_USMALLINT: {
      uint32_t u16;
      sscanf(rawVal, "%" PRIu32, &u16);
      EXPECT_EQ(cv->value.u16, (uint16_t)u16);
    } break;
    case TSDB_DATA_TYPE_UINT: {
      sscanf(rawVal, "%" PRIu32, &rawSVal.u32);
      EXPECT_EQ(cv->value.u32, rawSVal.u32);
    } break;
    case TSDB_DATA_TYPE_UBIGINT: {
      sscanf(rawVal, "%" PRIu64, &rawSVal.u64);
      EXPECT_EQ(cv->value.u64, rawSVal.u64);
    } break;
    case TSDB_DATA_TYPE_JSON:
      printf("JSON ");
      break;
    case TSDB_DATA_TYPE_VARBINARY:
      printf("VARBIN ");
      break;
    case TSDB_DATA_TYPE_DECIMAL:
      printf("DECIMAL ");
      break;
    case TSDB_DATA_TYPE_BLOB:
      printf("BLOB ");
      break;
    case TSDB_DATA_TYPE_MEDIUMBLOB:
      printf("MedBLOB ");
      break;
    // case TSDB_DATA_TYPE_BINARY:
    //   printf("BINARY ");
    //   break;
    case TSDB_DATA_TYPE_MAX:
      printf("UNDEF ");
      break;
    default:
      printf("UNDEF ");
      break;
  }
  return 0;
}

static void checkTSRow(const char **data, STSRow2 *row, STSchema *pTSchema) {
H
Hongze Cheng 已提交
396
  for (int16_t i = 0; i < pTSchema->numOfCols; ++i) {
C
Cary Xu 已提交
397 398 399 400 401 402 403
    SColVal cv = {0};
    tTSRowGet(row, pTSchema, i, &cv);
    checkSColVal(data[i], &cv, pTSchema->columns[i].type);
  }
}

TEST(testCase, AllNormTest) {
C
Cary Xu 已提交
404
  int16_t       nCols = 14;
405
  STSRowBuilder rb = {0};
C
Cary Xu 已提交
406 407
  STSRow2      *row = nullptr;
  SArray       *pArray = taosArrayInit(nCols, sizeof(SColVal));
C
Cary Xu 已提交
408 409 410 411 412 413 414
  EXPECT_NE(pArray, nullptr);

  STSchema *pTSchema = genSTSchema(nCols);
  EXPECT_NE(pTSchema, nullptr);

  // ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 binary(10), c6 nchar(10), c7 tinyint, c8 smallint,
  // c9 bool
C
Cary Xu 已提交
415
  char *data[14] = {"1653694220000", "no", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "no", "no", "no", "no", "no"};
C
Cary Xu 已提交
416 417 418

  genTestData((const char **)&data, nCols, &pArray);

C
Cary Xu 已提交
419
  tTSRowNew(&rb, pArray, pTSchema, &row);
C
Cary Xu 已提交
420 421 422 423

  debugPrintTSRow(row, pTSchema, __func__, __LINE__);
  checkTSRow((const char **)&data, row, pTSchema);

C
Cary Xu 已提交
424
  tsRowBuilderClear(&rb);
C
Cary Xu 已提交
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444
  taosArrayDestroy(pArray);
  taosMemoryFree(pTSchema);
}

#if 1
TEST(testCase, NoneTest) {
  const static int nCols = 14;
  const static int nRows = 20;
  STSRow2         *row = nullptr;
  SArray          *pArray = taosArrayInit(nCols, sizeof(SColVal));
  EXPECT_NE(pArray, nullptr);

  STSchema *pTSchema = genSTSchema(nCols);
  EXPECT_NE(pTSchema, nullptr);

  // ts timestamp,  c1 int,  c2 bigint,  c3 float,  c4 double,  c5 binary(10),  c6 nchar(10),  c7 tinyint,  c8 smallint,
  // c9 bool c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned
  const char *data[nRows][nCols] = {
      {"1653694220000", "no", "20", "10.1", "10.1", "binary10", "no", "10", "10", "nu", "10", "20", "30", "40"},
      {"1653694220001", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no"},
C
Cary Xu 已提交
445 446
      {"1653694220002", "10", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no"},
      {"1653694220003", "10", "10", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no"},
C
Cary Xu 已提交
447 448 449
      {"1653694220004", "no", "20", "no", "no", "no", "nchar10", "no", "no", "no", "no", "no", "no", "no"},
      {"1653694220005", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "nu"},
      {"1653694220006", "no", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "nu"},
C
Cary Xu 已提交
450
      {"1653694220007", "no", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "no", "no", "no", "no", "no"},
C
Cary Xu 已提交
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471
      {"1653694220008", "no", "nu", "nu", "nu", "binary10", "nu", "nu", "nu", "nu", "nu", "nu", "nu", "no"},
      {"1653694220009", "no", "nu", "nu", "nu", "binary10", "nu", "nu", "10", "no", "nu", "nu", "nu", "100"},
      {"1653694220010", "-1", "-1", "-1", "-1", "binary10", "nu", "-1", "0", "0", "0", "0", "0", "0"},
      {"1653694220011", "-2147483648", "nu", "nu", "nu", "biy10", "nu", "nu", "32767", "no", "nu", "nu", "nu", "100"},
      {"1653694220012", "2147483647", "nu", "nu", "nu", "ary10", "nu", "nu", "-32768", "no", "nu", "nu", "nu", "100"},
      {"1653694220013", "no", "-9223372036854775818", "nu", "nu", "b1", "nu", "nu", "10", "no", "nu", "nu", "nu", "nu"},
      {"1653694220014", "no", "nu", "nu", "nu", "b0", "nu", "nu", "10", "no", "nu", "nu", "nu", "9223372036854775808"},
      {"1653694220015", "no", "nu", "nu", "nu", "binary30", "char4", "nu", "10", "no", "nu", "nu", "nu",
       "18446744073709551615"},
      {"1653694220016", "2147483647", "nu", "nu", "nu", "bin50", "nu", "nu", "10", "no", "nu", "nu", "nu", "100"},
      {"1653694220017", "2147483646", "0", "0", "0", "binary10", "0", "0", "0", "0", "255", "0", "0", "0"},
      {"1653694220018", "no", "-9223372036854775808", "nu", "nu", "binary10", "nu", "nu", "10", "no", "nu", "nu",
       "4294967295", "100"},
      {"1653694220019", "no", "9223372036854775807", "nu", "nu", "bin10", "nu", "nu", "10", "no", "254", "nu", "nu",
       "no"}};

  for (int r = 0; r < nRows; ++r) {
    genTestData((const char **)&data[r], nCols, &pArray);
    tTSRowNew(NULL, pArray, pTSchema, &row);
    debugPrintTSRow(row, pTSchema, __func__, __LINE__);  // debug print
    checkTSRow((const char **)&data[r], row, pTSchema);  // check
C
Cary Xu 已提交
472
    tTSRowFree(row);
C
Cary Xu 已提交
473 474 475 476 477 478 479
    taosArrayClear(pArray);
  }

  taosArrayDestroy(pArray);
  taosMemoryFree(pTSchema);
}
#endif