This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new cfc15dec90a Update Python examples (#14640)
cfc15dec90a is described below
commit cfc15dec90a90fffb70ea3f9bca891f3b631a1ad
Author: Haonan <[email protected]>
AuthorDate: Tue Jan 7 10:51:25 2025 +0800
Update Python examples (#14640)
* Update table_model_session_example.py
* Update table_model_session_pool_example.py
---
iotdb-client/client-py/table_model_session_example.py | 12 ++++++------
iotdb-client/client-py/table_model_session_pool_example.py | 8 ++++----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/iotdb-client/client-py/table_model_session_example.py
b/iotdb-client/client-py/table_model_session_example.py
index 4d2ef0730d3..86aac09da2d 100644
--- a/iotdb-client/client-py/table_model_session_example.py
+++ b/iotdb-client/client-py/table_model_session_example.py
@@ -39,13 +39,13 @@ session.execute_non_query_statement("use test2")
# or use full qualified table name
session.execute_non_query_statement(
"create table test1.table1("
- "region_id STRING ID, plant_id STRING ID, device_id STRING ID, "
- "model STRING ATTRIBUTE, temperature FLOAT MEASUREMENT, humidity DOUBLE
MEASUREMENT) with (TTL=3600000)"
+ "region_id STRING TAG, plant_id STRING TAG, device_id STRING TAG, "
+ "model STRING ATTRIBUTE, temperature FLOAT FIELD, humidity DOUBLE FIELD)
with (TTL=3600000)"
)
session.execute_non_query_statement(
"create table table2("
- "region_id STRING ID, plant_id STRING ID, color STRING ATTRIBUTE,
temperature FLOAT MEASUREMENT,"
- " speed DOUBLE MEASUREMENT) with (TTL=6600000)"
+ "region_id STRING TAG, plant_id STRING TAG, color STRING ATTRIBUTE,
temperature FLOAT FIELD,"
+ " speed DOUBLE FIELD) with (TTL=6600000)"
)
# show tables from current database
@@ -101,9 +101,9 @@ session = TableSession(config)
session.execute_non_query_statement("CREATE DATABASE IF NOT EXISTS db1")
session.execute_non_query_statement('USE "db1"')
session.execute_non_query_statement(
- "CREATE TABLE table5 (id1 string id, attr1 string attribute, "
+ "CREATE TABLE table5 (id1 string TAG, attr1 string attribute, "
+ "m1 double "
- + "measurement)"
+ + "FIELD)"
)
column_names = [
diff --git a/iotdb-client/client-py/table_model_session_pool_example.py
b/iotdb-client/client-py/table_model_session_pool_example.py
index 156ba8a450d..bd190a8b473 100644
--- a/iotdb-client/client-py/table_model_session_pool_example.py
+++ b/iotdb-client/client-py/table_model_session_pool_example.py
@@ -32,14 +32,14 @@ def prepare_data():
session.execute_non_query_statement("CREATE DATABASE IF NOT EXISTS db1")
session.execute_non_query_statement('USE "db1"')
session.execute_non_query_statement(
- "CREATE TABLE table0 (id1 string id, attr1 string attribute, "
+ "CREATE TABLE table0 (id1 string tag, attr1 string attribute, "
+ "m1 double "
- + "measurement)"
+ + "field)"
)
session.execute_non_query_statement(
- "CREATE TABLE table1 (id1 string id, attr1 string attribute, "
+ "CREATE TABLE table1 (id1 string tag, attr1 string attribute, "
+ "m1 double "
- + "measurement)"
+ + "field)"
)
print("now the tables are:")