Alima777 commented on a change in pull request #829: [IoTDB-508] Add AlignByDeviceQuery documents URL: https://github.com/apache/incubator-iotdb/pull/829#discussion_r383683506
########## File path: docs/Documentation-CHN/SystemDesign/5-DataQuery/6-AlignByDeviceQuery.md ########## @@ -0,0 +1,199 @@ +<!-- + + 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. + +--> + +# 按设备对齐查询 + +AlignByDevicePlan 即按设备对齐查询对应的表结构为: + +| Time | Device | sensor1 | sensor2 | sensor3 | ... | +| ---- | ------ | ------- | ------- | ------- | --- | +| | | | | | | + +## 设计原理 + +按设备对齐查询其实现原理主要是计算出查询中每个设备对应的映射值和过滤条件,然后将查询按设备分别进行,最后将结果集拼装并返回。 + +### AlignByDevicePlan 中重要字段含义 + +首先解释一下 AlignByDevicePlan 中一些重要字段的含义: + +- dataTypeMapping: 该变量继承自基类 QueryPlan,其主要作用是在计算每个设备的执行路径时,提供此次查询的 paths 对应的数据类型。在按设备对齐查询中,基类中的 paths 字段除了有验证的额外作用外,和 dataTypes 字段主要都是为这个字段服务。 Review comment: 再往上的基类 PhysicalPlan 有抽象方法 getPaths(),所以 QueryPlan 里还是要有 paths 字段的吧。。 ---------------------------------------------------------------- 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] With regards, Apache Git Services
