You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by su...@apache.org on 2020/11/18 13:53:08 UTC

[iotdb] branch jira-1015 created (now 6175b9d)

This is an automated email from the ASF dual-hosted git repository.

sunzesong pushed a change to branch jira-1015
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at 6175b9d  [IOTDB-1015] Add document for session query API and examples for align by device

This branch includes the following new commits:

     new 6175b9d  [IOTDB-1015] Add document for session query API and examples for align by device

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: [IOTDB-1015] Add document for session query API and examples for align by device

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sunzesong pushed a commit to branch jira-1015
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 6175b9db83b7e19348728d1966063897d683eaa7
Author: samperson1997 <sz...@mails.tsinghua.edu.cn>
AuthorDate: Wed Nov 18 21:52:28 2020 +0800

    [IOTDB-1015] Add document for session query API and examples for align by device
---
 docs/UserGuide/Client/Programming - Native API.md  | 22 ++++++++++++++++++++--
 .../DML Data Manipulation Language.md              | 12 ++++++++++--
 .../UserGuide/Client/Programming - Native API.md   | 18 ++++++++++++++++++
 .../DML Data Manipulation Language.md              | 14 +++++++++++---
 .../java/org/apache/iotdb/session/Session.java     |  2 +-
 5 files changed, 60 insertions(+), 8 deletions(-)

diff --git a/docs/UserGuide/Client/Programming - Native API.md b/docs/UserGuide/Client/Programming - Native API.md
index 58fc6f6..a1c6791 100644
--- a/docs/UserGuide/Client/Programming - Native API.md	
+++ b/docs/UserGuide/Client/Programming - Native API.md	
@@ -150,6 +150,24 @@ Here we show the commonly used interfaces and their parameters in the Native API
         List<List<String>> measurementsList, List<List<TSDataType>> typesList,
         List<List<Object>> valuesList)
   ```
+  
+* Raw data query. Time interval include startTime and exclude endTime
+
+  ```
+  SessionDataSet executeRawDataQuery(List<String> paths, long startTime, long endTime)
+  ```
+
+* Execute query statement
+
+  ```
+  SessionDataSet executeQueryStatement(String sql)
+  ```
+  
+* Execute non query statement
+
+  ```
+  void executeNonQueryStatement(String sql)
+  ```
 
 ## Native APIs for profiling network cost
 
@@ -217,8 +235,8 @@ Or `example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java`
 
 ## 0.9-0.10 Session Interface Updates
 
-Significant chages are made in IoTDB session of version 0.10 compared to version 0.9.
-A large numbers of new interfaces are added, and some old interfaces have new names or parameters.
+Significant changes are made in IoTDB session of version 0.10 compared to version 0.9.
+A number of new interfaces are added, and some old interfaces have new names or parameters.
 Besides, all exceptions thrown by session interfaces are changed from *IoTDBSessionExeception* to *IoTDBConnectionException* or *StatementExecutionExeception*.
 The detailed modifications are listed as follows.
 
diff --git a/docs/UserGuide/Operation Manual/DML Data Manipulation Language.md b/docs/UserGuide/Operation Manual/DML Data Manipulation Language.md
index b6aa4a8..b700c98 100644
--- a/docs/UserGuide/Operation Manual/DML Data Manipulation Language.md	
+++ b/docs/UserGuide/Operation Manual/DML Data Manipulation Language.md	
@@ -742,12 +742,20 @@ The 'align by device' indicates that the deviceId is considered as a column. The
 The SQL statement is:
 
 ```
-select s1,s2 from root.sg1.* ALIGN BY DEVICE
+select s1,s2 from root.sg1.* align by device
 ```
 
 For more syntax description, please read SQL REFERENCE.
 
-The 'disable align' indicaes that there are 3 columns for each time series in the resultset. For more syntax description, please read SQL REFERENCE.
+The 'disable align' indicates that there are 3 columns for each time series in the result set. Disable Align Clause can only be used at the end of a query statement. Disable Align Clause cannot be used with Aggregation, Fill Statements, Group By or Group By Device Statements, but can with Limit Statements. The display principle of the result table is that only when the column (or row) has existing data will the column (or row) be shown, with nonexistent cells being empty.
+
+The SQL statement is:
+
+```
+select * from root.sg1 where time > 10 disable align
+```
+
+For more syntax description, please read SQL REFERENCE.
 
 ####  Error Handling
 
diff --git a/docs/zh/UserGuide/Client/Programming - Native API.md b/docs/zh/UserGuide/Client/Programming - Native API.md
index 5d40f08..affd9cd 100644
--- a/docs/zh/UserGuide/Client/Programming - Native API.md	
+++ b/docs/zh/UserGuide/Client/Programming - Native API.md	
@@ -148,6 +148,24 @@
   ```
 
 
+* 原始数据查询。时间间隔包含开始时间,不包含结束时间
+
+  ```
+  SessionDataSet executeRawDataQuery(List<String> paths, long startTime, long endTime)
+  ```
+
+* 执行查询语句
+
+  ```
+  SessionDataSet executeQueryStatement(String sql)
+  ```
+  
+* 执行非查询语句
+
+  ```
+  void executeNonQueryStatement(String sql)
+  ```
+
 ## 测试客户端逻辑+网络传输代价的接口
 
 * 测试 testInsertRecords,不实际写入数据,只将数据传输到 server 即返回。
diff --git a/docs/zh/UserGuide/Operation Manual/DML Data Manipulation Language.md b/docs/zh/UserGuide/Operation Manual/DML Data Manipulation Language.md
index bdd32a9..eeed92a 100644
--- a/docs/zh/UserGuide/Operation Manual/DML Data Manipulation Language.md	
+++ b/docs/zh/UserGuide/Operation Manual/DML Data Manipulation Language.md	
@@ -171,12 +171,20 @@ IoTDB支持另外两种结果返回形式: 按设备时间对齐 'align by devic
 'align by device' 对齐方式下,设备ID会单独作为一列出现。在 select 子句中写了多少列,最终结果就会有该列数+2 (时间列和设备名字列)。SQL形如:
 
 ```
-select s1,s2 from root.sg1.* GROUP BY DEVICE
+select s1,s2 from root.sg1.* align by device
 ```
 
-更多语法请参照 SQL REFERENCE.
+更多语法请参照 SQL REFERENCE。
 
-'disable align' 意味着每条时序就有3列存在。更多语法请参照 SQL REFERENCE.
+'disable align' 意味着每条时序就有3列存在。Disable Align只能用于查询语句句尾,不能用于聚合查询、Fill语句、Group by或Group by device语句,但可用于Limit语句。结果显示若无数据显示为空白。
+
+SQL形如:
+
+```
+select * from root.sg1 where time > 10 disable align
+```
+
+更多语法请参照 SQL REFERENCE。
 
 ### 聚合查询
 本章节主要介绍聚合查询的相关示例,
diff --git a/session/src/main/java/org/apache/iotdb/session/Session.java b/session/src/main/java/org/apache/iotdb/session/Session.java
index d4abb13..d0389eb 100644
--- a/session/src/main/java/org/apache/iotdb/session/Session.java
+++ b/session/src/main/java/org/apache/iotdb/session/Session.java
@@ -942,7 +942,7 @@ public class Session {
 
 
   /**
-   * execure query sql
+   * execute query sql
    *
    * @param sql query statement
    * @return result set