You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@iotdb.apache.org by Eric Pai <er...@hotmail.com> on 2021/10/19 08:29:34 UTC

The order of the result of ALIGNED BY DEVICE

Hi, all,

The result set our ALIGEND BY DEVICE query returns contains two important columns: timestamp and device.

See the implementation of AlignByDeviceDataSet https://github.com/apache/iotdb/blob/e4b7f64deb54b3fc186424cf969a68bff23a6fc7/server/src/main/java/org/apache/iotdb/db/query/dataset/AlignByDeviceDataSet.java#L129-L226

It iterates device firstly, and then timestamp. So what is the order of the devices? Is it sorted by alphabet? I didn't find any explanations in the official documents.
In my opinion, other strange and unpredictable sorting method may hard to be understood and explained, and the most important, implemented in a cluster query. As it supports LIMIT and OFFSET clauses, the query result should be stable and consistent both in standalone and cluster environment, if they have the same data.


Re: The order of the result of ALIGNED BY DEVICE

Posted by Xiangdong Huang <sa...@gmail.com>.
Hi,

I vote for using a stable order rather than hash order.

Can be set an issue.

Best,
-----------------------------------
Xiangdong Huang
School of Software, Tsinghua University

 黄向东
清华大学 软件学院

Eric Pai <er...@hotmail.com> 于2021年10月19日周二 下午4:29写道:
>
> Hi, all,
>
> The result set our ALIGEND BY DEVICE query returns contains two important columns: timestamp and device.
>
> See the implementation of AlignByDeviceDataSet https://github.com/apache/iotdb/blob/e4b7f64deb54b3fc186424cf969a68bff23a6fc7/server/src/main/java/org/apache/iotdb/db/query/dataset/AlignByDeviceDataSet.java#L129-L226
>
> It iterates device firstly, and then timestamp. So what is the order of the devices? Is it sorted by alphabet? I didn't find any explanations in the official documents.
> In my opinion, other strange and unpredictable sorting method may hard to be understood and explained, and the most important, implemented in a cluster query. As it supports LIMIT and OFFSET clauses, the query result should be stable and consistent both in standalone and cluster environment, if they have the same data.
>