Alima777 commented on a change in pull request #1114:
URL: https://github.com/apache/incubator-iotdb/pull/1114#discussion_r417897636



##########
File path: docs/zh/SystemDesign/2-QueryEngine/4-QueryHeader.md
##########
@@ -0,0 +1,101 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 查询结果集表头构造
+
+## 内容简介
+
+本文主要介绍原始数据查询(RawDataQuery)、按设备对齐查询(AlignByDeviceQuery)、最新数据查询(LastQuery)三种查询的结果集表头构造方法。如降频聚合查询、空值填充查询等查询将作为子查询在该三类查询中讲解。
+
+## 原始数据查询
+
+原始数据查询的结果集表头构造逻辑主要在 `getWideQueryHeaders()` 方法中。
+
+- org.apache.iotdb.db.service.TSServiceImpl.getWideQueryHeaders
+
+对于每个结果集表头的构造,需要提供列名及该列对应的数据类型。
+
+- 
普通原始数据查询(包括空值填充查询)只需要从物理查询计划中取得**未去重**的时间序列路径,该时间序列路径即作为列名,并使用该路径取得时间序列对应的数据类型,即可生成结果集表头。
+
+- 
而如果原始数据查询中包含聚合函数(包括一般聚合查询和降频聚合查询),将忽略时间列并使用**聚合函数和时间序列路径共同构成列名**,且取得数据类型时将以聚合函数的类型为准,如
 `root.sg.d1.s1` 是 FLOAT 类型,而 `count(root.sg.d1.s1)` 应为 INT 类型。

Review comment:
       Fixed~




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to