apache / apache/iotdb

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

Open
#10,288 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.4k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
115

Description

### 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!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the provided insertRecordsOfOneDevice example against apache-iotdb-1.1.0 and inspect the C++ client implementation of that entry point. Compare the inserted FLOAT and INT32 values with the expected query output; done means the query returns 1.0 and 292 instead of the corrupted values.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.