提交 a3e12271 编写于 作者: H hzcheng

more

上级 e80611c1
...@@ -33,28 +33,33 @@ TEST(TsdbTest, createRepo) { ...@@ -33,28 +33,33 @@ TEST(TsdbTest, createRepo) {
tsdbCreateTable(pRepo, &tCfg); tsdbCreateTable(pRepo, &tCfg);
// // 3. Loop to write some simple data // // 3. Loop to write some simple data
// int nRows = 10; int nRows = 10;
// SSubmitMsg *pMsg = (SSubmitMsg *)malloc(sizeof(SSubmitMsg) + sizeof(SSubmitBlk) + tdMaxRowBytesFromSchema(schema) * nRows); SSubmitMsg *pMsg = (SSubmitMsg *)malloc(sizeof(SSubmitMsg) + sizeof(SSubmitBlk) + tdMaxRowBytesFromSchema(schema) * nRows);
// SSubmitBlk *pBlock = pMsg->blocks; SSubmitBlk *pBlock = pMsg->blocks;
// pBlock->tableId = {.uid = 987607499877672L, .tid = 0}; pBlock->tableId = {.uid = 987607499877672L, .tid = 0};
// pBlock->sversion = 0; pBlock->sversion = 0;
// pBlock->len = 0; pBlock->len = 0;
// int64_t start_time = 1584081000000; int64_t start_time = 1584081000000;
// for (int i = 0; i < nRows; i++) { for (int i = 0; i < nRows; i++) {
// int64_t ttime = start_time + 1000 * i; int64_t ttime = start_time + 1000 * i;
// SDataRow row = (SDataRow)(pBlock->data + pBlock->len); SDataRow row = (SDataRow)(pBlock->data + pBlock->len);
// dataRowInit(row); tdInitDataRow(row, schema);
// for (int j; j < schemaNCols(schema); j++) { for (int j; j < schemaNCols(schema); j++) {
// if (j == 0) { // Just for timestamp if (j == 0) { // Just for timestamp
// tdAppendColVal(row, (void *)(&time), schemaColAt(schema, i), ); tdAppendColVal(row, (void *)(&time), schemaColAt(schema, i));
// } else { // For int } else { // For int
int val = 10;
// } tdAppendColVal(row, (void *)(&val), schemaColAt(schema, i));
// } }
// pBlock->len += dataRowLen(row); pBlock->len += dataRowLen(row);
// } }
pMsg->length = pMsg->length + sizeof(SSubmitBlk) + pBlock->len;
}
tsdbInsertData(pRepo, pMsg);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册