This is an automated email from the ASF dual-hosted git repository. sunzesong pushed a commit to branch jira_1439 in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 11712c7af3ff6bbd9d908ac994e9d9dc69ba82f1 Author: samperson1997 <[email protected]> AuthorDate: Tue Jun 15 00:56:40 2021 +0800 [IOTDB-1439] Update user guide documents according to the new interfaces --- docs/UserGuide/API/Programming-Java-Native-API.md | 15 +++++++------ docs/UserGuide/Appendix/SQL-Reference.md | 16 +++++++------- .../DDL-Data-Definition-Language.md | 25 ---------------------- .../DML-Data-Manipulation-Language.md | 7 ------ .../UserGuide/API/Programming-Java-Native-API.md | 21 +++++++----------- docs/zh/UserGuide/Appendix/SQL-Reference.md | 12 +++++------ .../DDL-Data-Definition-Language.md | 25 ---------------------- .../DML-Data-Manipulation-Language.md | 7 ------ 8 files changed, 30 insertions(+), 98 deletions(-) diff --git a/docs/UserGuide/API/Programming-Java-Native-API.md b/docs/UserGuide/API/Programming-Java-Native-API.md index 2e7b465..a09a067 100644 --- a/docs/UserGuide/API/Programming-Java-Native-API.md +++ b/docs/UserGuide/API/Programming-Java-Native-API.md @@ -103,7 +103,7 @@ void createMultiTimeseries(List<String> paths, List<TSDataType> dataTypes, * Create aligned timeseries ``` -void createAlignedTimeseries(String devicePath, List<String> measurements, +void createAlignedTimeseries(String prefixPath, List<String> measurements, List<TSDataType> dataTypes, List<TSEncoding> encodings, CompressionType compressor, List<String> measurementAliasList); ``` @@ -127,7 +127,7 @@ void deleteData(List<String> paths, long time) * Insert a Record,which contains multiple measurement value of a device at a timestamp. Without type info the server has to do type inference, which may cost some time ```java -void insertRecord(String deviceId, long time, List<String> measurements, List<String> values) +void insertRecord(String prefixPath, long time, List<String> measurements, List<String> values) ``` * Insert a Tablet,which is multiple rows of a device, each row has the same measurements @@ -269,7 +269,7 @@ Examples: ```session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest Or `example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java` -For examples of aligned timeseries and device template, you can refer to `example/session/src/main/java/org/apache/iotdb/VectorSessionExample.java` +For examples of aligned timeseries and device template, you can refer to `example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java` @@ -382,8 +382,9 @@ Open a session and specifies whether the Leader cache is enabled. Note that this * a list and add to encodings if it is a vector measurement, put all encodings of the * vector into a list and add to encodings * compressors: List of compressors -void createDeviceTemplate( - String name, +void createSchemaTemplate( + String templateName, + List<String> schemaName, List<List<String>> measurements, List<List<TSDataType>> dataTypes, List<List<TSEncoding>> encodings, @@ -394,7 +395,7 @@ Create a device template, the param description at above ``` -void setDeviceTemplate(String templateName, String prefixPath) +void setSchemaTemplate(String templateName, String prefixPath) ``` @@ -402,7 +403,7 @@ Set the device template named 'templateName' at path 'prefixPath'. You should fi ``` -void createDeviceTemplate +void createSchemaTemplate ``` diff --git a/docs/UserGuide/Appendix/SQL-Reference.md b/docs/UserGuide/Appendix/SQL-Reference.md index c9ac7a4..77b9e65 100644 --- a/docs/UserGuide/Appendix/SQL-Reference.md +++ b/docs/UserGuide/Appendix/SQL-Reference.md @@ -104,25 +104,25 @@ Note: For SDT, it is optional to set compression minimum COMPMINTIME, which is t Note: For SDT, it is optional to set compression maximum COMPMAXTIME, which is the maximum time difference between stored values regardless of COMPDEV. ``` -* Create device template +* Create schema template ``` -CREATE device template <TemplateName> WITH <AttributeClauses> +CREATE schema template <TemplateName> WITH <AttributeClauses> attributeClauses : (MEASUREMENT_NAME DATATYPE OPERATOR_EQ dataType COMMA ENCODING OPERATOR_EQ encoding (COMMA (COMPRESSOR | COMPRESSION) OPERATOR_EQ compressor=propertyValue)? (COMMA property)*) attributeClause ; -Eg: create device template temp1( +Eg: create schema template temp1( (s1 INT32 with encoding=Gorilla, compression=SNAPPY), (s2 FLOAT with encoding=RLE, compression=SNAPPY) ) ``` -* Set device template +* Set schema template ``` -set device template <TemplateName> to <STORAGE_GROUP_NAME> -Eg: set device template temp1 to root.beijing +set schema template <TemplateName> to <STORAGE_GROUP_NAME> +Eg: set schema template temp1 to root.beijing ``` * Delete Timeseries Statement @@ -324,8 +324,8 @@ CREATE SNAPSHOT FOR SCHEMA * Insert Record Statement ``` -INSERT INTO <PrefixPath> LPAREN TIMESTAMP COMMA <MeasurementName> [COMMA <MeasurementName>]* RPAREN VALUES LPAREN <TimeValue>, <PointValue> [COMMA <PointValue>]* RPAREN -MeasurementName : Identifier | LPAREN Identifier (COMMA Identifier)+ RPAREN +INSERT INTO <PrefixPath> LPAREN TIMESTAMP COMMA <Sensor> [COMMA <Sensor>]* RPAREN VALUES LPAREN <TimeValue>, <PointValue> [COMMA <PointValue>]* RPAREN +Sensor : Identifier Eg: IoTDB > INSERT INTO root.ln.wf01.wt01(timestamp,status) values(1509465600000,true) Eg: IoTDB > INSERT INTO root.ln.wf01.wt01(timestamp,status) VALUES(NOW(), false) Eg: IoTDB > INSERT INTO root.ln.wf01.wt01(timestamp,temperature) VALUES(2017-11-01T00:17:00.000+08:00,24.22028) diff --git a/docs/UserGuide/IoTDB-SQL-Language/DDL-Data-Definition-Language.md b/docs/UserGuide/IoTDB-SQL-Language/DDL-Data-Definition-Language.md index e2fe36c..beaf865 100644 --- a/docs/UserGuide/IoTDB-SQL-Language/DDL-Data-Definition-Language.md +++ b/docs/UserGuide/IoTDB-SQL-Language/DDL-Data-Definition-Language.md @@ -91,15 +91,6 @@ IoTDB > create timeseries root.sgcc.wf03.wt01.status with datatype=BOOLEAN,encod IoTDB > create timeseries root.sgcc.wf03.wt01.temperature with datatype=FLOAT,encoding=RLE ``` -We could also create **aligned** timeseries: - -``` -IoTDB > create aligned timeseries root.sg.d1.(s1 FLOAT, s2 INT32) -IoTDB > create aligned timeseries root.sg.d1.(s3 FLOAT, s4 INT32) with encoding=(RLE, Grollia), compression=SNAPPY -``` - -Attention: Aligned timeseries must have the same compression type. - Notice that when in the CREATE TIMESERIES statement the encoding method conflicts with the data type, the system gives the corresponding error prompt as shown below: ``` @@ -109,22 +100,6 @@ error: encoding TS_2DIFF does not support BOOLEAN Please refer to [Encoding](../Data-Concept/Encoding.md) for correspondence between data type and encoding. -### Create and set device template -``` - -IoTDB > set storage group root.beijing - -// create a device templat -IoTDB > create device template temp1( - (s1 INT32 with encoding=Gorilla, compression=SNAPPY), - (s2 FLOAT with encoding=RLE, compression=SNAPPY) - ) - -// set device template to storage group "root.beijing" -IoTDB > set device template temp1 to root.beijing - -``` - #### Delete Timeseries To delete the timeseries we created before, we are able to use `DELETE TimeSeries <PrefixPath>` statement. diff --git a/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md b/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md index 4ded88e..bc0b9d5 100644 --- a/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md +++ b/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md @@ -76,13 +76,6 @@ Total line number = 4 It costs 0.170s ``` -As for **aligned** timeseries,we could insert values into measurements by **explicit** declaration with parentheses. Empty values could be represented by `NULL` or `null`: - -``` -IoTDB > insert into root.sg.d1(timestamp,(s1,s2),(s3,s4)) values (1509466680000,(1.0,2),(null,4)) -IoTDB > insert into root.sg.d1(timestamp,(s1,s2)) values (1509466680001,(NULL,1)) -``` - ## SELECT ### Time Slice Query diff --git a/docs/zh/UserGuide/API/Programming-Java-Native-API.md b/docs/zh/UserGuide/API/Programming-Java-Native-API.md index 7a6471b..9316b49 100644 --- a/docs/zh/UserGuide/API/Programming-Java-Native-API.md +++ b/docs/zh/UserGuide/API/Programming-Java-Native-API.md @@ -105,7 +105,7 @@ void createMultiTimeseries(List<String> paths, List<TSDataType> dataTypes, * 创建对齐时间序列 ``` -void createAlignedTimeseries(String devicePath, List<String> measurements, +void createAlignedTimeseries(String prefixPath, List<String> measurements, List<TSDataType> dataTypes, List<TSEncoding> encodings, CompressionType compressor, List<String> measurementAliasList); ``` @@ -129,7 +129,7 @@ void deleteData(List<String> paths, long time) * 插入一个 Record,一个 Record 是一个设备一个时间戳下多个测点的数据。服务器需要做类型推断,可能会有额外耗时 ```java -void insertRecord(String deviceId, long time, List<String> measurements, List<String> values) +void insertRecord(String prefixPath, long time, List<String> measurements, List<String> values) ``` * 插入一个 Tablet,Tablet 是一个设备若干行非空数据块,每一行的列都相同 @@ -154,7 +154,7 @@ void insertRecords(List<String> deviceIds, List<Long> times, * 插入一个 Record,一个 Record 是一个设备一个时间戳下多个测点的数据。提供数据类型后,服务器不需要做类型推断,可以提高性能 ```java -void insertRecord(String deviceId, long time, List<String> measurements, +void insertRecord(String prefixPath, long time, List<String> measurements, List<TSDataType> types, List<Object> values) ``` @@ -203,24 +203,21 @@ void executeNonQueryStatement(String sql) * encodings: 编码类型名称列表,如果该工况是非对齐的,直接将其数据类型放入一个list中再放入encodings中, 如果该工况是对齐的,将所有对齐工况的编码类型放入一个list再放入encodings中 * compressors: 压缩方式列表 -void createDeviceTemplate( - String name, +void createSchemaTemplate( + String templateName, + List<String> schemaName, List<List<String>> measurements, List<List<TSDataType>> dataTypes, List<List<TSEncoding>> encodings, List<CompressionType> compressors) ``` - * 将名为'templateName'的设备模板挂载到'prefixPath'路径下,在执行这一步之前,你需要创建名为'templateName'的设备模板 ``` -void setDeviceTemplate(String templateName, String prefixPath) +void setSchemaTemplate(String templateName, String prefixPath) ``` - - - ### 测试接口说明 * 测试 testInsertRecords,不实际写入数据,只将数据传输到 server 即返回。 @@ -276,9 +273,7 @@ void testInsertTablet(Tablet tablet) 或 `example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java` -使用对齐时间序列和设备模板的示例可以参见 `example/session/src/main/java/org/apache/iotdb/VectorSessionExample.java`。 - - +使用对齐时间序列和设备模板的示例可以参见 `example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java`。 ### 示例代码 diff --git a/docs/zh/UserGuide/Appendix/SQL-Reference.md b/docs/zh/UserGuide/Appendix/SQL-Reference.md index f6efde4..faca9c3 100644 --- a/docs/zh/UserGuide/Appendix/SQL-Reference.md +++ b/docs/zh/UserGuide/Appendix/SQL-Reference.md @@ -96,14 +96,14 @@ Note: For SDT, it is optional to set compression maximum COMPMAXTIME, which is t * 创建设备模板语句 ``` -CREATE device template <TemplateName> WITH <AttributeClauses> +CREATE schema template <TemplateName> WITH <AttributeClauses> attributeClauses : (MEASUREMENT_NAME DATATYPE OPERATOR_EQ dataType COMMA ENCODING OPERATOR_EQ encoding (COMMA (COMPRESSOR | COMPRESSION) OPERATOR_EQ compressor=propertyValue)? (COMMA property)*) attributeClause ; -Eg: create device template temp1( +Eg: create schema template temp1( (s1 INT32 with encoding=Gorilla, compression=SNAPPY), (s2 FLOAT with encoding=RLE, compression=SNAPPY) ) @@ -111,8 +111,8 @@ Eg: create device template temp1( * 挂载设备模板语句 ``` -set device template <TemplateName> to <STORAGE_GROUP_NAME> -Eg: set device template temp1 to root.beijing +set schema template <TemplateName> to <STORAGE_GROUP_NAME> +Eg: set schema template temp1 to root.beijing ``` * 删除时间序列语句 @@ -318,8 +318,8 @@ CREATE SNAPSHOT FOR SCHEMA * 插入记录语句 ``` -INSERT INTO <PrefixPath> LPAREN TIMESTAMP COMMA <MeasurementName> [COMMA <MeasurementName>]* RPAREN VALUES LPAREN <TimeValue>, <PointValue> [COMMA <PointValue>]* RPAREN -MeasurementName : Identifier | LPAREN Identifier (COMMA Identifier)+ RPAREN +INSERT INTO <PrefixPath> LPAREN TIMESTAMP COMMA <Sensor> [COMMA <Sensor>]* RPAREN VALUES LPAREN <TimeValue>, <PointValue> [COMMA <PointValue>]* RPAREN +Sensor : Identifier Eg: IoTDB > INSERT INTO root.ln.wf01.wt01(timestamp,status) values(1509465600000,true) Eg: IoTDB > INSERT INTO root.ln.wf01.wt01(timestamp,status) VALUES(NOW(), false) Eg: IoTDB > INSERT INTO root.ln.wf01.wt01(timestamp,temperature) VALUES(2017-11-01T00:17:00.000+08:00,24.22028) diff --git a/docs/zh/UserGuide/IoTDB-SQL-Language/DDL-Data-Definition-Language.md b/docs/zh/UserGuide/IoTDB-SQL-Language/DDL-Data-Definition-Language.md index fd369e3..76a1d3c 100644 --- a/docs/zh/UserGuide/IoTDB-SQL-Language/DDL-Data-Definition-Language.md +++ b/docs/zh/UserGuide/IoTDB-SQL-Language/DDL-Data-Definition-Language.md @@ -93,15 +93,6 @@ IoTDB > create timeseries root.sgcc.wf03.wt01.status with datatype=BOOLEAN,encod IoTDB > create timeseries root.sgcc.wf03.wt01.temperature with datatype=FLOAT,encoding=RLE ``` -我们也可以创建**对齐**时间序列: - -``` -IoTDB > create aligned timeseries root.sg.d1.(s1 FLOAT, s2 INT32) -IoTDB > create aligned timeseries root.sg.d1.(s3 FLOAT, s4 INT32) with encoding=(RLE, Grollia), compression=SNAPPY -``` - -注意:对齐时间序列必须拥有相同的压缩方式。 - 需要注意的是,当创建时间序列时指定的编码方式与数据类型不对应时,系统会给出相应的错误提示,如下所示: ``` IoTDB> create timeseries root.ln.wf02.wt02.status WITH DATATYPE=BOOLEAN, ENCODING=TS_2DIFF @@ -110,22 +101,6 @@ error: encoding TS_2DIFF does not support BOOLEAN 详细的数据类型与编码方式的对应列表请参见[编码方式](../Data-Concept/Encoding.md)。 -### 创建和挂载设备模板 -``` - -IoTDB > set storage group root.beijing - -// 创建设备模板 -IoTDB > create device template temp1( - (s1 INT32 with encoding=Gorilla, compression=SNAPPY), - (s2 FLOAT with encoding=RLE, compression=SNAPPY) - ) - -// 将设备模板挂载到root.beijing存储组上 -IoTDB > set device template temp1 to root.beijing - -``` - #### 删除时间序列 我们可以使用`DELETE TimeSeries <PrefixPath>`语句来删除我们之前创建的时间序列。SQL语句如下所示: diff --git a/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md b/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md index 3c8648e..41b75aa 100644 --- a/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md +++ b/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md @@ -77,13 +77,6 @@ Total line number = 4 It costs 0.170s ``` -对于**对齐**时间序列而言,可以通过括号来**显式地**同时向序列中所有传感器插入值。其中,空值可以用 `NULL` 或者 `null` 占用: - -``` -IoTDB > insert into root.sg.d1(timestamp,(s1,s2),(s3,s4)) values (1509466680000,(1.0,2),(null,4)) -IoTDB > insert into root.sg.d1(timestamp,(s1,s2)) values (1509466680001,(NULL,1)) -``` - ### 数据查询 #### 时间条件过滤查询
