You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/08/14 08:41:52 UTC

[GitHub] [iotdb] jixuan1989 commented on issue #6981: 跨设备查询时的时间排序问题

jixuan1989 commented on issue #6981:
URL: https://github.com/apache/iotdb/issues/6981#issuecomment-1214312517

   current `align by device` sql does not support align by device first and then align by time.
   
   But using the default query, you can get  the result order by time. However, this kind of query is not friendly for cases which have many devices. 
   
   ```sql
   IoTDB> insert into root.sg1.d1(time, s1) values (1, 2);
   Msg: The statement is executed successfully.
   IoTDB> insert into root.sg1.d1(time, s1) values (5, 2);
   Msg: The statement is executed successfully.
   IoTDB> insert into root.sg1.d2(time, s1) values (3, 2);
   Msg: The statement is executed successfully.
   IoTDB> select * from root.**;
   +-----------------------------+--------------+--------------+
   |                         Time|root.sg1.d1.s1|root.sg1.d2.s1|
   +-----------------------------+--------------+--------------+
   |1970-01-01T08:00:00.001+08:00|           2.0|          null|
   |1970-01-01T08:00:00.003+08:00|          null|           2.0|
   |1970-01-01T08:00:00.005+08:00|           2.0|          null|
   +-----------------------------+--------------+--------------+
   Total line number = 3
   It costs 0.182s
   IoTDB> select * from root.** align by device;
   +-----------------------------+-----------+---+
   |                         Time|     Device| s1|
   +-----------------------------+-----------+---+
   |1970-01-01T08:00:00.001+08:00|root.sg1.d1|2.0|
   |1970-01-01T08:00:00.005+08:00|root.sg1.d1|2.0|
   |1970-01-01T08:00:00.003+08:00|root.sg1.d2|2.0|
   +-----------------------------+-----------+---+
   Total line number = 3
   It costs 0.047s
   ```
   
   
   


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

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org