Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a1dc417
refactor
Caideyipi Jan 8, 2026
2d9e40e
partial
Caideyipi Jan 8, 2026
c8eafa8
ref
Caideyipi Jan 8, 2026
bd5e678
ref
Caideyipi Jan 9, 2026
e054247
Merge branch 'master' of https://github.com/apache/iotdb into clean
Caideyipi Jan 9, 2026
5851451
fix
Caideyipi Jan 9, 2026
85ead0a
ref
Caideyipi Jan 9, 2026
906cb45
fix
Caideyipi Jan 9, 2026
8de2b3c
fix
Caideyipi Jan 9, 2026
23864bb
large-wave
Caideyipi Jan 9, 2026
4216ef4
sg
Caideyipi Jan 9, 2026
417b05a
55562
Caideyipi Jan 9, 2026
beed891
fix
Caideyipi Jan 9, 2026
b634204
fix
Caideyipi Jan 9, 2026
1d57a4e
mb
Caideyipi Jan 9, 2026
3660635
f
Caideyipi Jan 9, 2026
a6d7491
fix
Caideyipi Jan 9, 2026
f6dba27
back
Caideyipi Jan 9, 2026
6a9f2fb
db
Caideyipi Jan 9, 2026
2cff28e
db
Caideyipi Jan 9, 2026
bd9cda4
db_in
Caideyipi Jan 9, 2026
c92b251
fix
Caideyipi Jan 9, 2026
a21a6f7
fix
Caideyipi Jan 9, 2026
ac4c1b6
fix
Caideyipi Jan 9, 2026
1669cfb
fldz
Caideyipi Jan 9, 2026
1db1f82
Update IoTDBLoadTsFileIT.java
Caideyipi Jan 9, 2026
7ab9d5e
man
Caideyipi Jan 9, 2026
21a62c4
mbout
Caideyipi Jan 9, 2026
e5ad632
cx
Caideyipi Jan 9, 2026
44a2350
mb
Caideyipi Jan 9, 2026
f4cd533
source
Caideyipi Jan 9, 2026
6f77229
fix
Caideyipi Jan 9, 2026
2f8fa6a
partial
Caideyipi Jan 9, 2026
3ee57a2
fix
Caideyipi Jan 9, 2026
b67865c
large-p
Caideyipi Jan 9, 2026
f7cc0f6
fix
Caideyipi Jan 9, 2026
0a32cac
mbt
Caideyipi Jan 9, 2026
93ea4ae
sink
Caideyipi Jan 9, 2026
51fc4d0
why
Caideyipi Jan 9, 2026
a7244c3
ll
Caideyipi Jan 9, 2026
4b2b1fe
sptls
Caideyipi Jan 9, 2026
7aea87b
hb
Caideyipi Jan 9, 2026
76b2e21
by
Caideyipi Jan 9, 2026
2bf2011
sp
Caideyipi Jan 9, 2026
1652232
m
Caideyipi Jan 9, 2026
d0fa4a2
mm
Caideyipi Jan 9, 2026
387d487
m
Caideyipi Jan 9, 2026
7e57cdb
f
Caideyipi Jan 9, 2026
8de3605
fix
Caideyipi Jan 9, 2026
2ef38e2
cf
Caideyipi Jan 9, 2026
1c61d28
fix
Caideyipi Jan 9, 2026
e1b466b
bishop
Caideyipi Jan 9, 2026
46e9797
fix
Caideyipi Jan 9, 2026
7e4cba3
f
Caideyipi Jan 9, 2026
2971cee
match-full
Caideyipi Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 23 additions & 23 deletions example/client-cpp-example/src/AlignedTimeseriesSessionExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Session *session;
#define DEFAULT_ROW_NUMBER 1000000

void createAlignedTimeseries() {
string alignedDeviceId = "root.sg1.d1";
string alignedDeviceId = "root.db1.d1";
vector<string> measurements = {"s1", "s2", "s3"};
vector<string> alignedTimeseries = {"root.sg1.d1.s1", "root.sg1.d1.s2", "root.sg1.d1.s3"};
vector<string> alignedTimeseries = {"root.db1.d1.s1", "root.db1.d1.s2", "root.db1.d1.s3"};
vector<TSDataType::TSDataType> dataTypes = {TSDataType::INT32, TSDataType::DOUBLE, TSDataType::BOOLEAN};
vector<TSEncoding::TSEncoding> encodings = {TSEncoding::PLAIN, TSEncoding::GORILLA, TSEncoding::RLE};
vector<CompressionType::CompressionType> compressors = {
Expand Down Expand Up @@ -60,12 +60,12 @@ void createSchemaTemplate() {
temp.addToTemplate(mNodeS2);

session->createSchemaTemplate(temp);
session->setSchemaTemplate("template1", "root.sg3.d1");
session->setSchemaTemplate("template1", "root.db3.d1");
}
}

void ActivateTemplate() {
session->executeNonQueryStatement("insert into root.sg3.d1(timestamp,s1, s2) values(200, 1, 1);");
session->executeNonQueryStatement("insert into root.db3.d1(timestamp,s1, s2) values(200, 1, 1);");
}

void showDevices() {
Expand Down Expand Up @@ -101,7 +101,7 @@ void showTimeseries() {
}

void insertAlignedRecord() {
string deviceId = "root.sg1.d1";
string deviceId = "root.db1.d1";
vector<string> measurements;
measurements.emplace_back("s1");
measurements.emplace_back("s2");
Expand All @@ -117,7 +117,7 @@ void insertAlignedRecord() {
}

void insertAlignedRecords() {
string deviceId = "root.sg1.d1";
string deviceId = "root.db1.d1";
vector<string> measurements;
measurements.emplace_back("s1");
measurements.emplace_back("s2");
Expand Down Expand Up @@ -159,7 +159,7 @@ void insertAlignedTablet() {
schemas.push_back(pairB);
schemas.push_back(pairC);

Tablet tablet("root.sg2.d2", schemas, 100000);
Tablet tablet("root.db2.d2", schemas, 100000);
tablet.setAligned(true);

for (int64_t time = 0; time < DEFAULT_ROW_NUMBER; time++) {
Expand Down Expand Up @@ -192,14 +192,14 @@ void insertAlignedTablets() {
schemas.push_back(pairB);
schemas.push_back(pairC);

Tablet tablet1("root.sg1.d1", schemas, 100);
Tablet tablet2("root.sg1.d2", schemas, 100);
Tablet tablet3("root.sg1.d3", schemas, 100);
Tablet tablet1("root.db1.d1", schemas, 100);
Tablet tablet2("root.db1.d2", schemas, 100);
Tablet tablet3("root.db1.d3", schemas, 100);

unordered_map<string, Tablet *> tabletMap;
tabletMap["root.sg1.d1"] = &tablet1;
tabletMap["root.sg1.d2"] = &tablet2;
tabletMap["root.sg1.d3"] = &tablet3;
tabletMap["root.db1.d1"] = &tablet1;
tabletMap["root.db1.d2"] = &tablet2;
tabletMap["root.db1.d3"] = &tablet3;

for (int64_t time = 0; time < 20; time++) {
size_t row1 = tablet1.rowSize++;
Expand Down Expand Up @@ -256,7 +256,7 @@ void insertNullableTabletWithAlignedTimeseries() {
schemas.push_back(pairB);
schemas.push_back(pairC);

Tablet tablet("root.sg1.d4", schemas, 20);
Tablet tablet("root.db1.d4", schemas, 20);
tablet.setAligned(true);

for (int64_t time = 0; time < 20; time++) {
Expand Down Expand Up @@ -291,7 +291,7 @@ void insertNullableTabletWithAlignedTimeseries() {
}

void query() {
unique_ptr<SessionDataSet> dataSet = session->executeQueryStatement("select * from root.sg1.**");
unique_ptr<SessionDataSet> dataSet = session->executeQueryStatement("select * from root.db1.**");
cout << "timestamp" << " ";
for (const string &name: dataSet->getColumnNames()) {
cout << name << " ";
Expand All @@ -315,11 +315,11 @@ void deleteData() {

void deleteTimeseries() {
vector<string> paths;
vector<string> alignedTimeseries = {"root.sg1.d1.s1", "root.sg1.d1.s2", "root.sg1.d1.s3", "root.sg1.d1.s4",
"root.sg1.d2.s1", "root.sg1.d2.s2", "root.sg1.d2.s3",
"root.sg1.d3.s1", "root.sg1.d3.s2", "root.sg1.d3.s3",
"root.sg1.d4.s1", "root.sg1.d4.s2", "root.sg1.d4.s3",
"root.sg2.d2.s1", "root.sg2.d2.s2", "root.sg2.d2.s3", };
vector<string> alignedTimeseries = {"root.db1.d1.s1", "root.db1.d1.s2", "root.db1.d1.s3", "root.db1.d1.s4",
"root.db1.d2.s1", "root.db1.d2.s2", "root.db1.d2.s3",
"root.db1.d3.s1", "root.db1.d3.s2", "root.db1.d3.s3",
"root.db1.d4.s1", "root.db1.d4.s2", "root.db1.d4.s3",
"root.db2.d2.s1", "root.db2.d2.s2", "root.db2.d2.s3", };
for (const string &timeseries: alignedTimeseries) {
if (session->checkTimeseriesExists(timeseries)) {
paths.push_back(timeseries);
Expand All @@ -330,8 +330,8 @@ void deleteTimeseries() {

void deleteStorageGroups() {
vector<string> storageGroups;
storageGroups.emplace_back("root.sg1");
storageGroups.emplace_back("root.sg2");
storageGroups.emplace_back("root.db1");
storageGroups.emplace_back("root.db2");
session->deleteStorageGroups(storageGroups);
}

Expand All @@ -346,7 +346,7 @@ int main() {

cout << "setStorageGroup\n" << endl;
try {
session->setStorageGroup("root.sg1");
session->setStorageGroup("root.db1");
}
catch (IoTDBException &e) {
string errorMessage(e.what());
Expand Down
68 changes: 34 additions & 34 deletions example/client-cpp-example/src/SessionExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,35 @@ using namespace std;
Session *session;

void createTimeseries() {
if (!session->checkTimeseriesExists("root.sg1.d1.s1")) {
session->createTimeseries("root.sg1.d1.s1", TSDataType::BOOLEAN, TSEncoding::RLE,
if (!session->checkTimeseriesExists("root.db1.d1.s1")) {
session->createTimeseries("root.db1.d1.s1", TSDataType::BOOLEAN, TSEncoding::RLE,
CompressionType::SNAPPY);
}
if (!session->checkTimeseriesExists("root.sg1.d1.s2")) {
session->createTimeseries("root.sg1.d1.s2", TSDataType::INT32, TSEncoding::RLE,
if (!session->checkTimeseriesExists("root.db1.d1.s2")) {
session->createTimeseries("root.db1.d1.s2", TSDataType::INT32, TSEncoding::RLE,
CompressionType::SNAPPY);
}
if (!session->checkTimeseriesExists("root.sg1.d1.s3")) {
session->createTimeseries("root.sg1.d1.s3", TSDataType::FLOAT, TSEncoding::RLE,
if (!session->checkTimeseriesExists("root.db1.d1.s3")) {
session->createTimeseries("root.db1.d1.s3", TSDataType::FLOAT, TSEncoding::RLE,
CompressionType::SNAPPY);
}

// create timeseries with tags and attributes
if (!session->checkTimeseriesExists("root.sg1.d1.s4")) {
if (!session->checkTimeseriesExists("root.db1.d1.s4")) {
map<string, string> tags;
tags["tag1"] = "v1";
map<string, string> attributes;
attributes["description"] = "v1";
session->createTimeseries("root.sg1.d1.s4", TSDataType::INT64, TSEncoding::RLE,
session->createTimeseries("root.db1.d1.s4", TSDataType::INT64, TSEncoding::RLE,
CompressionType::SNAPPY, nullptr, &tags, &attributes, "temperature");
}
}

void createMultiTimeseries() {
if (!session->checkTimeseriesExists("root.sg1.d2.s1") && !session->checkTimeseriesExists("root.sg1.d2.s2")) {
if (!session->checkTimeseriesExists("root.db1.d2.s1") && !session->checkTimeseriesExists("root.db1.d2.s2")) {
vector<string> paths;
paths.emplace_back("root.sg1.d2.s1");
paths.emplace_back("root.sg1.d2.s2");
paths.emplace_back("root.db1.d2.s1");
paths.emplace_back("root.db1.d2.s2");
vector<TSDataType::TSDataType> tsDataTypes;
tsDataTypes.push_back(TSDataType::INT64);
tsDataTypes.push_back(TSDataType::DOUBLE);
Expand Down Expand Up @@ -104,12 +104,12 @@ void createSchemaTemplate() {
temp.addToTemplate(mNodeS2);

session->createSchemaTemplate(temp);
session->setSchemaTemplate("template1", "root.sg3.d1");
session->setSchemaTemplate("template1", "root.db3.d1");
}
}

void ActivateTemplate() {
session->executeNonQueryStatement("insert into root.sg3.d1(timestamp,s1, s2) values(200, 1, 1);");
session->executeNonQueryStatement("insert into root.db3.d1(timestamp,s1, s2) values(200, 1, 1);");
}

void showTimeseries() {
Expand All @@ -129,7 +129,7 @@ void showTimeseries() {
}

void insertRecord() {
string deviceId = "root.sg2.d1";
string deviceId = "root.db2.d1";
vector<string> measurements;
measurements.emplace_back("s1");
measurements.emplace_back("s2");
Expand All @@ -152,7 +152,7 @@ void insertTablet() {
schemas.push_back(pairB);
schemas.push_back(pairC);

Tablet tablet("root.sg1.d1", schemas, 100);
Tablet tablet("root.db1.d1", schemas, 100);

for (int64_t time = 0; time < 30; time++) {
size_t row = tablet.rowSize++;
Expand Down Expand Up @@ -180,7 +180,7 @@ void insertTablet() {
}

void insertRecords() {
string deviceId = "root.sg2.d1";
string deviceId = "root.db2.d1";
vector<string> measurements;
measurements.emplace_back("s1");
measurements.emplace_back("s2");
Expand Down Expand Up @@ -222,12 +222,12 @@ void insertTablets() {
schemas.push_back(pairB);
schemas.push_back(pairC);

Tablet tablet1("root.sg1.d2", schemas, 100);
Tablet tablet2("root.sg1.d3", schemas, 100);
Tablet tablet1("root.db1.d2", schemas, 100);
Tablet tablet2("root.db1.d3", schemas, 100);

unordered_map<string, Tablet *> tabletMap;
tabletMap["root.sg1.d2"] = &tablet1;
tabletMap["root.sg1.d3"] = &tablet2;
tabletMap["root.db1.d2"] = &tablet1;
tabletMap["root.db1.d3"] = &tablet2;

for (int64_t time = 0; time < 30; time++) {
size_t row1 = tablet1.rowSize++;
Expand Down Expand Up @@ -285,7 +285,7 @@ void insertTabletWithNullValues() {
schemas.push_back(pairB);
schemas.push_back(pairC);

Tablet tablet("root.sg1.d4", schemas, 30);
Tablet tablet("root.db1.d4", schemas, 30);

for (int64_t time = 0; time < 30; time++) {
size_t row = tablet.rowSize++;
Expand All @@ -311,7 +311,7 @@ void insertTabletWithNullValues() {
}

void nonQuery() {
session->executeNonQueryStatement("insert into root.sg1.d1(timestamp,s1) values(100, 1);");
session->executeNonQueryStatement("insert into root.db1.d1(timestamp,s1) values(100, 1);");
}

void query() {
Expand All @@ -331,18 +331,18 @@ void query() {
}

void deleteData() {
string path = "root.sg1.d1.s1";
string path = "root.db1.d1.s1";
int64_t deleteTime = 99;
session->deleteData(path, deleteTime);
}

void deleteTimeseries() {
vector<string> paths;
vector<string> timeseriesGrp = { "root.sg1.d1.s1", "root.sg1.d1.s2", "root.sg1.d1.s3",
"root.sg1.d2.s1", "root.sg1.d2.s2", "root.sg1.d2.s3",
"root.sg1.d3.s1", "root.sg1.d3.s2", "root.sg1.d3.s3",
"root.sg1.d4.s1", "root.sg1.d4.s2", "root.sg1.d4.s3",
"root.sg2.d1.s1", "root.sg2.d1.s2", "root.sg2.d1.s3" };
vector<string> timeseriesGrp = { "root.db1.d1.s1", "root.db1.d1.s2", "root.db1.d1.s3",
"root.db1.d2.s1", "root.db1.d2.s2", "root.db1.d2.s3",
"root.db1.d3.s1", "root.db1.d3.s2", "root.db1.d3.s3",
"root.db1.d4.s1", "root.db1.d4.s2", "root.db1.d4.s3",
"root.db2.d1.s1", "root.db2.d1.s2", "root.db2.d1.s3" };
for (const string& timeseries : timeseriesGrp) {
if (session->checkTimeseriesExists(timeseries)) {
paths.push_back(timeseries);
Expand All @@ -353,8 +353,8 @@ void deleteTimeseries() {

void deleteStorageGroups() {
vector<string> storageGroups;
storageGroups.emplace_back("root.sg1");
storageGroups.emplace_back("root.sg2");
storageGroups.emplace_back("root.db1");
storageGroups.emplace_back("root.db2");
session->deleteStorageGroups(storageGroups);
}

Expand All @@ -379,9 +379,9 @@ int main() {
session = new Session("127.0.0.1", 6667, "root", "root");
session->open(false);

cout << "setStorageGroup: root.sg1\n" << endl;
cout << "setStorageGroup: root.db1\n" << endl;
try {
session->setStorageGroup("root.sg1");
session->setStorageGroup("root.db1");
}
catch (IoTDBException &e) {
string errorMessage(e.what());
Expand All @@ -391,9 +391,9 @@ int main() {
//throw e;
}

cout << "setStorageGroup: root.sg2\n" << endl;
cout << "setStorageGroup: root.db2\n" << endl;
try {
session->setStorageGroup("root.sg2");
session->setStorageGroup("root.db2");
}
catch (IoTDBException &e) {
string errorMessage(e.what());
Expand Down
18 changes: 9 additions & 9 deletions example/jdbc/src/main/java/org/apache/iotdb/JDBCExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ public static void main(String[] args) throws ClassNotFoundException, SQLExcepti
// set JDBC fetchSize
statement.setFetchSize(10000);

statement.execute("CREATE DATABASE root.sg1");
statement.execute("CREATE DATABASE root.db1");
statement.execute(
"CREATE TIMESERIES root.sg1.d1.s1 WITH DATATYPE=INT64, ENCODING=RLE, COMPRESSOR=SNAPPY");
"CREATE TIMESERIES root.db1.d1.s1 WITH DATATYPE=INT64, ENCODING=RLE, COMPRESSOR=SNAPPY");
statement.execute(
"CREATE TIMESERIES root.sg1.d1.s2 WITH DATATYPE=INT64, ENCODING=RLE, COMPRESSOR=SNAPPY");
"CREATE TIMESERIES root.db1.d1.s2 WITH DATATYPE=INT64, ENCODING=RLE, COMPRESSOR=SNAPPY");
statement.execute(
"CREATE TIMESERIES root.sg1.d1.s3 WITH DATATYPE=INT64, ENCODING=RLE, COMPRESSOR=SNAPPY");
"CREATE TIMESERIES root.db1.d1.s3 WITH DATATYPE=INT64, ENCODING=RLE, COMPRESSOR=SNAPPY");
statement.execute(
"CREATE TIMESERIES root.sg1.d1.s4 WITH DATATYPE=DATE, ENCODING=PLAIN, COMPRESSOR=SNAPPY");
"CREATE TIMESERIES root.db1.d1.s4 WITH DATATYPE=DATE, ENCODING=PLAIN, COMPRESSOR=SNAPPY");
statement.execute(
"CREATE TIMESERIES root.sg1.d1.s5 WITH DATATYPE=TIMESTAMP, ENCODING=PLAIN, COMPRESSOR=SNAPPY");
"CREATE TIMESERIES root.db1.d1.s5 WITH DATATYPE=TIMESTAMP, ENCODING=PLAIN, COMPRESSOR=SNAPPY");
statement.execute(
"CREATE TIMESERIES root.sg1.d1.s6 WITH DATATYPE=BLOB, ENCODING=PLAIN, COMPRESSOR=SNAPPY");
"CREATE TIMESERIES root.db1.d1.s6 WITH DATATYPE=BLOB, ENCODING=PLAIN, COMPRESSOR=SNAPPY");
statement.execute(
"CREATE TIMESERIES root.sg1.d1.s7 WITH DATATYPE=STRING, ENCODING=PLAIN, COMPRESSOR=SNAPPY");
"CREATE TIMESERIES root.db1.d1.s7 WITH DATATYPE=STRING, ENCODING=PLAIN, COMPRESSOR=SNAPPY");

for (int i = 0; i <= 100; i++) {
statement.addBatch(prepareInsertStatement(i));
Expand Down Expand Up @@ -107,7 +107,7 @@ private static void outputResult(ResultSet resultSet) throws SQLException {

private static String prepareInsertStatement(int time) {
return String.format(
"insert into root.sg1.d1(timestamp, s1, s2, s3, s4, s5, s6, s7) values(%d, %d, %d, %d, \"%s\", %d, %s, \"%s\")",
"insert into root.db1.d1(timestamp, s1, s2, s3, s4, s5, s6, s7) values(%d, %d, %d, %d, \"%s\", %d, %s, \"%s\")",
time, 1, 1, 1, LocalDate.of(2024, 5, time % 31 + 1), time, "X'cafebabe'", time);
}
}
Loading
Loading