apache / apache/iotdb

[c++ client] insertRecordsOfOneDevice写入的结果

未关闭
#10,288 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
6.4k
派生
1.2k
平均合并
1 天 23 小时
30 天内合并 PR
115

描述

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.

### Version

apache-iotdb-1.1.0-all-bin

### Describe the bug and provide the minimal reproduce step

std::vector times;
std::vector> measurementsList;
std::vector> typesList;
std::vector> valuesList;
string deviceId = "root.data.iHyperDB" + std::to_string(1);

std::vector measurement;
std::vector type;
std::vector value;

measurement.emplace_back("value");
measurement.emplace_back("quality");
type.emplace_back(TSDataType::FLOAT);
type.emplace_back(TSDataType::INT32);
times.emplace_back(111);

measurementsList.emplace_back(measurement);

typesList.emplace_back(type);

auto va = std::to_string(1.0);
char* temp = new char[va.size() + 1];
std::strcpy(temp, va.c_str());
value.emplace_back(temp);

va = std::to_string(292);
temp = new char[va.size() + 1];
std::strcpy(temp, va.c_str());
value.emplace_back(temp);
valuesList.emplace_back(value);

ses->insertRecordsOfOneDevice(deviceId, times, measurementsList, typesList, valuesList);

### What did you expect to see?

+-----------------------------+---------------------+-------------------------+---------------------------+
| Time|root.data.iHyperDB1.a|root.data.iHyperDB1.value|root.data.iHyperDB1.quality|
+-----------------------------+---------------------+-------------------------+---------------------------+
|1970-01-01T08:00:00.111+08:00| null| 1.0| 292|
+-----------------------------+---------------------+-------------------------+---------------------------+

### What did you see instead?

+-----------------------------+---------------------+-------------------------+---------------------------+
| Time|root.data.iHyperDB1.a|root.data.iHyperDB1.value|root.data.iHyperDB1.quality|
+-----------------------------+---------------------+-------------------------+---------------------------+
|1970-01-01T08:00:00.111+08:00| null| 6.409407E-10| 3291442|
+-----------------------------+---------------------+-------------------------+---------------------------+

### Anything else?

_No response_

### Are you willing to submit a PR?

- [X] I'm willing to submit a PR!

贡献指南

打开贡献指南

调研方向

首先,针对 apache-iotdb-1.1.0 重现提供的 insertRecordsOfOneDevice 示例,并检查该入口点的 C++ 客户端实现。将插入的 FLOAT 和 INT32 值与预期的查询输出进行比较;当查询返回 1.0 和 292,而不是损坏的值时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp
领域
api, database
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。