zhilinli123 commented on code in PR #5404:
URL: https://github.com/apache/seatunnel/pull/5404#discussion_r1314643008
##########
docs/en/connector-v2/sink/IoTDB.md:
##########
@@ -68,78 +68,124 @@ There is a conflict of thrift version between IoTDB and
Spark.Therefore, you nee
| connection_timeout_in_ms | Integer | No | -
| The maximum time (in ms) to wait when connecting to `IoTDB`
|
| common-options | | no | -
| Sink plugin common parameters, please refer to [Sink Common
Options](common-options.md) for details
|
-## Task Example
+## Examples
+
+```hocon
+env {
+ execution.parallelism = 2
+ job.mode = "BATCH"
+}
+
+source {
+ FakeSource {
+ row.num = 16
+ bigint.template = [1664035200001]
+ schema = {
+ fields {
+ device_name = "string"
+ temperature = "float"
+ moisture = "int"
+ event_ts = "bigint"
+ c_string = "string"
+ c_boolean = "boolean"
+ c_tinyint = "tinyint"
+ c_smallint = "smallint"
+ c_int = "int"
+ c_bigint = "bigint"
+ c_float = "float"
+ c_double = "double"
+ }
+ }
+ }
+}
+
+...
+
+```
+
+Upstream SeaTunnelRow data format is the following:
+
+| device_name | temperature | moisture | event_ts | c_string
| c_boolean | c_tinyint | c_smallint | c_int | c_bigint | c_float | c_double |
+|--------------------------|-------------|----------|---------------|----------|-----------|-----------|------------|-------|------------|---------|----------|
+| root.test_group.device_a | 36.1 | 100 | 1664035200001 | abc1
| true | 1 | 1 | 1 | 2147483648 | 1.0 | 1.0 |
+| root.test_group.device_b | 36.2 | 101 | 1664035200001 | abc2
| false | 2 | 2 | 2 | 2147483649 | 2.0 | 2.0 |
+| root.test_group.device_c | 36.3 | 102 | 1664035200001 | abc3
| false | 3 | 3 | 3 | 2147483649 | 3.0 | 3.0 |
### Case1
-Common options:
+only fill required config.
+use current processing time as timestamp. and include all fields but exclude
`device` & `timestamp` as measurement fields
```hocon
sink {
IoTDB {
- node_urls = ["localhost:6667"]
+ node_urls = "localhost:6667"
username = "root"
password = "root"
- batch_size = 1024
+ key_device = "device_name"
}
}
```
-When you assign `key_device` is `device_name`, for example:
+Output to `IoTDB` data format is the following:
+
+```shell
+IoTDB> SELECT * FROM root.test_group.* align by device;
++------------------------+------------------------+--------------+-----------+--------------+---------+----------+----------+-----------+------+-----------+--------+---------+
+| Time| Device| temperature| moisture|
event_ts| c_string| c_boolean| c_tinyint| c_smallint| c_int| c_bigint|
c_float| c_double|
++------------------------+------------------------+--------------+-----------+--------------+---------+----------+----------+-----------+------+-----------+--------+---------+
+|2023-09-01T00:00:00.001Z|root.test_group.device_a| 36.1| 100|
1664035200001| abc1| true| 1| 1| 1| 2147483648|
1.0| 1.0|
+|2023-09-01T00:00:00.001Z|root.test_group.device_b| 36.2| 101|
1664035200001| abc2| false| 2| 2| 2| 2147483649|
2.0| 2.0|
+|2023-09-01T00:00:00.001Z|root.test_group.device_c| 36.3| 102|
1664035200001| abc2| false| 3| 3| 3| 2147483649|
3.0| 3.0|
++------------------------+------------------------+--------------+-----------+--------------+---------+---------+-----------+-----------+------+-----------+--------+---------+
+```
+
+### Case2
+
+use source event's time
```hocon
sink {
IoTDB {
- ...
+ node_urls = "localhost:6667"
+ username = "root"
+ password = "root"
key_device = "device_name"
+ key_timestamp = "event_ts"
Review Comment:
Add some description to this? What does the configuration need to pay
attention to to tell us the user what it does?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]