This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git
The following commit(s) were added to refs/heads/main by this push:
new 4f839450 add sessiondataset next function usage note to table cpp api
(#948)
4f839450 is described below
commit 4f839450405c7184a9ea797470650eec9d972963
Author: leto-b <[email protected]>
AuthorDate: Mon Jan 5 10:37:38 2026 +0800
add sessiondataset next function usage note to table cpp api (#948)
---
src/UserGuide/Master/Table/API/Programming-Cpp-Native-API_apache.md | 1 +
src/UserGuide/Master/Table/API/Programming-Cpp-Native-API_timecho.md | 1 +
src/UserGuide/latest-Table/API/Programming-Cpp-Native-API_apache.md | 1 +
src/UserGuide/latest-Table/API/Programming-Cpp-Native-API_timecho.md | 1 +
src/zh/UserGuide/Master/Table/API/Programming-Cpp-Native-API_apache.md | 1 +
src/zh/UserGuide/Master/Table/API/Programming-Cpp-Native-API_timecho.md | 1 +
src/zh/UserGuide/latest-Table/API/Programming-Cpp-Native-API_apache.md | 1 +
src/zh/UserGuide/latest-Table/API/Programming-Cpp-Native-API_timecho.md | 1 +
8 files changed, 8 insertions(+)
diff --git
a/src/UserGuide/Master/Table/API/Programming-Cpp-Native-API_apache.md
b/src/UserGuide/Master/Table/API/Programming-Cpp-Native-API_apache.md
index 8228dc1f..5f43b225 100644
--- a/src/UserGuide/Master/Table/API/Programming-Cpp-Native-API_apache.md
+++ b/src/UserGuide/Master/Table/API/Programming-Cpp-Native-API_apache.md
@@ -168,6 +168,7 @@ All operations in the C++ client are performed through the
TableSession class. B
1. `insert(Tablet& tablet, bool sorted = false)`: Inserts a Tablet object
containing time series data into the database. The sorted parameter indicates
whether the rows in the tablet are already sorted by time.
2. `executeNonQueryStatement(string& sql)`: Executes non-query SQL statements,
such as DDL (Data Definition Language) or DML (Data Manipulation Language)
commands.
3. `executeQueryStatement(string& sql)`: Executes query SQL statements and
returns a SessionDataSet object containing the query results. The optional
timeoutInMs parameter indicates the timeout return time.
+ * Note: When retrieving rows of query results by calling
`SessionDataSet::next()`, you must store the returned
`std::shared_ptr<RowRecord>` object in a local scope variable (e.g.: `auto row
= dataSet->next();`) to ensure the validity of the data lifecycle. If you
access it directly via `.get()` or a raw pointer (e.g.,
`dataSet->next().get()`), the reference count of the smart pointer will drop to
zero, the data will be released immediately, and subsequent access will lead to
undefine [...]
4. `open(bool enableRPCCompression = false)`: Opens the connection and
determines whether to enable RPC compression (client state must match server
state, disabled by default).
5. `close()`: Closes the connection.
diff --git
a/src/UserGuide/Master/Table/API/Programming-Cpp-Native-API_timecho.md
b/src/UserGuide/Master/Table/API/Programming-Cpp-Native-API_timecho.md
index 22c41a53..0f281b65 100644
--- a/src/UserGuide/Master/Table/API/Programming-Cpp-Native-API_timecho.md
+++ b/src/UserGuide/Master/Table/API/Programming-Cpp-Native-API_timecho.md
@@ -168,6 +168,7 @@ All operations in the C++ client are performed through the
TableSession class. B
1. `insert(Tablet& tablet, bool sorted = false)`: Inserts a Tablet object
containing time series data into the database. The sorted parameter indicates
whether the rows in the tablet are already sorted by time.
2. `executeNonQueryStatement(string& sql)`: Executes non-query SQL statements,
such as DDL (Data Definition Language) or DML (Data Manipulation Language)
commands.
3. `executeQueryStatement(string& sql)`: Executes query SQL statements and
returns a SessionDataSet object containing the query results. The optional
timeoutInMs parameter indicates the timeout return time.
+ * Note: When retrieving rows of query results by calling
`SessionDataSet::next()`, you must store the returned
`std::shared_ptr<RowRecord>` object in a local scope variable (e.g.: `auto row
= dataSet->next();`) to ensure the validity of the data lifecycle. If you
access it directly via `.get()` or a raw pointer (e.g.,
`dataSet->next().get()`), the reference count of the smart pointer will drop to
zero, the data will be released immediately, and subsequent access will lead to
undefine [...]
4. `open(bool enableRPCCompression = false)`: Opens the connection and
determines whether to enable RPC compression (client state must match server
state, disabled by default).
5. `close()`: Closes the connection.
diff --git
a/src/UserGuide/latest-Table/API/Programming-Cpp-Native-API_apache.md
b/src/UserGuide/latest-Table/API/Programming-Cpp-Native-API_apache.md
index 8228dc1f..5f43b225 100644
--- a/src/UserGuide/latest-Table/API/Programming-Cpp-Native-API_apache.md
+++ b/src/UserGuide/latest-Table/API/Programming-Cpp-Native-API_apache.md
@@ -168,6 +168,7 @@ All operations in the C++ client are performed through the
TableSession class. B
1. `insert(Tablet& tablet, bool sorted = false)`: Inserts a Tablet object
containing time series data into the database. The sorted parameter indicates
whether the rows in the tablet are already sorted by time.
2. `executeNonQueryStatement(string& sql)`: Executes non-query SQL statements,
such as DDL (Data Definition Language) or DML (Data Manipulation Language)
commands.
3. `executeQueryStatement(string& sql)`: Executes query SQL statements and
returns a SessionDataSet object containing the query results. The optional
timeoutInMs parameter indicates the timeout return time.
+ * Note: When retrieving rows of query results by calling
`SessionDataSet::next()`, you must store the returned
`std::shared_ptr<RowRecord>` object in a local scope variable (e.g.: `auto row
= dataSet->next();`) to ensure the validity of the data lifecycle. If you
access it directly via `.get()` or a raw pointer (e.g.,
`dataSet->next().get()`), the reference count of the smart pointer will drop to
zero, the data will be released immediately, and subsequent access will lead to
undefine [...]
4. `open(bool enableRPCCompression = false)`: Opens the connection and
determines whether to enable RPC compression (client state must match server
state, disabled by default).
5. `close()`: Closes the connection.
diff --git
a/src/UserGuide/latest-Table/API/Programming-Cpp-Native-API_timecho.md
b/src/UserGuide/latest-Table/API/Programming-Cpp-Native-API_timecho.md
index 22c41a53..948f966e 100644
--- a/src/UserGuide/latest-Table/API/Programming-Cpp-Native-API_timecho.md
+++ b/src/UserGuide/latest-Table/API/Programming-Cpp-Native-API_timecho.md
@@ -168,6 +168,7 @@ All operations in the C++ client are performed through the
TableSession class. B
1. `insert(Tablet& tablet, bool sorted = false)`: Inserts a Tablet object
containing time series data into the database. The sorted parameter indicates
whether the rows in the tablet are already sorted by time.
2. `executeNonQueryStatement(string& sql)`: Executes non-query SQL statements,
such as DDL (Data Definition Language) or DML (Data Manipulation Language)
commands.
3. `executeQueryStatement(string& sql)`: Executes query SQL statements and
returns a SessionDataSet object containing the query results. The optional
timeoutInMs parameter indicates the timeout return time.
+ * Note: When retrieving rows of query results by calling
`SessionDataSet::next()`, you must store the returned
`std::shared_ptr<RowRecord>` object in a local scope variable (e.g.: `auto row
= dataSet->next();`) to ensure the validity of the data lifecycle. If you
access it directly via `.get()` or a raw pointer (e.g.,
`dataSet->next().get()`), the reference count of the smart pointer will drop to
zero, the data will be released immediately, and subsequent access will lead to
undefined [...]
4. `open(bool enableRPCCompression = false)`: Opens the connection and
determines whether to enable RPC compression (client state must match server
state, disabled by default).
5. `close()`: Closes the connection.
diff --git
a/src/zh/UserGuide/Master/Table/API/Programming-Cpp-Native-API_apache.md
b/src/zh/UserGuide/Master/Table/API/Programming-Cpp-Native-API_apache.md
index 535cc6ff..3910f543 100644
--- a/src/zh/UserGuide/Master/Table/API/Programming-Cpp-Native-API_apache.md
+++ b/src/zh/UserGuide/Master/Table/API/Programming-Cpp-Native-API_apache.md
@@ -181,6 +181,7 @@ C++ 客户端的操作均通过 TableSession 类进行,下面将给出 TableSe
1. `insert(Tablet& tablet, bool sorted =
false)`,将一个包含时间序列数据的Tablet对象插入到数据库中,sorted参数指明tablet中的行是否已按时间排序。
2. `executeNonQueryStatement(string&
sql)`,执行非查询SQL语句,如DDL(数据定义语言)或DML(数据操作语言)命令。
3. `executeQueryStatement(string&
sql)`,执行查询SQL语句,并返回包含查询结果的SessionDataSet对象,可选timeoutInMs参数指示超时返回时间。
+ * 注意:调用 `SessionDataSet::next()` 获取查询结果行时,必须将返回的
`std::shared_ptr<RowRecord>` 对象存储在局部作用域变量中(例如:`auto row =
dataSet->next();`),以确保数据生命周期有效。若直接通过 `.get()` 或裸指针访问(如
`dataSet->next().get()`),将导致智能指针引用计数归零,数据被立即释放,后续访问将引发未定义行为。
4. `open(bool enableRPCCompression =
false)`,开启连接,并决定是否启用RPC压缩(客户端状态须与服务端一致,默认不开启)。
5. `close()`,关闭连接。
diff --git
a/src/zh/UserGuide/Master/Table/API/Programming-Cpp-Native-API_timecho.md
b/src/zh/UserGuide/Master/Table/API/Programming-Cpp-Native-API_timecho.md
index 3b3b47c2..c569b795 100644
--- a/src/zh/UserGuide/Master/Table/API/Programming-Cpp-Native-API_timecho.md
+++ b/src/zh/UserGuide/Master/Table/API/Programming-Cpp-Native-API_timecho.md
@@ -181,6 +181,7 @@ C++ 客户端的操作均通过 TableSession 类进行,下面将给出 TableSe
1. `insert(Tablet& tablet, bool sorted =
false)`,将一个包含时间序列数据的Tablet对象插入到数据库中,sorted参数指明tablet中的行是否已按时间排序。
2. `executeNonQueryStatement(string&
sql)`,执行非查询SQL语句,如DDL(数据定义语言)或DML(数据操作语言)命令。
3. `executeQueryStatement(string&
sql)`,执行查询SQL语句,并返回包含查询结果的SessionDataSet对象,可选timeoutInMs参数指示超时返回时间。
+ * 注意:调用 `SessionDataSet::next()` 获取查询结果行时,必须将返回的
`std::shared_ptr<RowRecord>` 对象存储在局部作用域变量中(例如:`auto row =
dataSet->next();`),以确保数据生命周期有效。若直接通过 `.get()` 或裸指针访问(如
`dataSet->next().get()`),将导致智能指针引用计数归零,数据被立即释放,后续访问将引发未定义行为。
4. `open(bool enableRPCCompression =
false)`,开启连接,并决定是否启用RPC压缩(客户端状态须与服务端一致,默认不开启)。
5. `close()`,关闭连接。
diff --git
a/src/zh/UserGuide/latest-Table/API/Programming-Cpp-Native-API_apache.md
b/src/zh/UserGuide/latest-Table/API/Programming-Cpp-Native-API_apache.md
index 535cc6ff..8ea1c89b 100644
--- a/src/zh/UserGuide/latest-Table/API/Programming-Cpp-Native-API_apache.md
+++ b/src/zh/UserGuide/latest-Table/API/Programming-Cpp-Native-API_apache.md
@@ -181,6 +181,7 @@ C++ 客户端的操作均通过 TableSession 类进行,下面将给出 TableSe
1. `insert(Tablet& tablet, bool sorted =
false)`,将一个包含时间序列数据的Tablet对象插入到数据库中,sorted参数指明tablet中的行是否已按时间排序。
2. `executeNonQueryStatement(string&
sql)`,执行非查询SQL语句,如DDL(数据定义语言)或DML(数据操作语言)命令。
3. `executeQueryStatement(string&
sql)`,执行查询SQL语句,并返回包含查询结果的SessionDataSet对象,可选timeoutInMs参数指示超时返回时间。
+ * 注意:调用 `SessionDataSet::next()` 获取查询结果行时,必须将返回的
`std::shared_ptr<RowRecord>` 对象存储在局部作用域变量中(例如:`auto row =
dataSet->next();`),以确保数据生命周期有效。若直接通过 `.get()` 或裸指针访问(如
`dataSet->next().get()`),将导致智能指针引用计数归零,数据被立即释放,后续访问将引发未定义行为。
4. `open(bool enableRPCCompression =
false)`,开启连接,并决定是否启用RPC压缩(客户端状态须与服务端一致,默认不开启)。
5. `close()`,关闭连接。
diff --git
a/src/zh/UserGuide/latest-Table/API/Programming-Cpp-Native-API_timecho.md
b/src/zh/UserGuide/latest-Table/API/Programming-Cpp-Native-API_timecho.md
index 559c6d6e..44c7e3a4 100644
--- a/src/zh/UserGuide/latest-Table/API/Programming-Cpp-Native-API_timecho.md
+++ b/src/zh/UserGuide/latest-Table/API/Programming-Cpp-Native-API_timecho.md
@@ -181,6 +181,7 @@ C++ 客户端的操作均通过 TableSession 类进行,下面将给出 TableSe
1. `insert(Tablet& tablet, bool sorted =
false)`,将一个包含时间序列数据的Tablet对象插入到数据库中,sorted参数指明tablet中的行是否已按时间排序。
2. `executeNonQueryStatement(string&
sql)`,执行非查询SQL语句,如DDL(数据定义语言)或DML(数据操作语言)命令。
3. `executeQueryStatement(string&
sql)`,执行查询SQL语句,并返回包含查询结果的SessionDataSet对象,可选timeoutInMs参数指示超时返回时间。
+ * 注意:调用 `SessionDataSet::next()` 获取查询结果行时,必须将返回的
`std::shared_ptr<RowRecord>` 对象存储在局部作用域变量中(例如:`auto row =
dataSet->next();`),以确保数据生命周期有效。若直接通过 `.get()` 或裸指针访问(如
`dataSet->next().get()`),将导致智能指针引用计数归零,数据被立即释放,后续访问将引发未定义行为。
4. `open(bool enableRPCCompression =
false)`,开启连接,并决定是否启用RPC压缩(客户端状态须与服务端一致,默认不开启)。
5. `close()`,关闭连接。