Hi,

I want to make a discussion about the interfaces about querying the number of 
timeseries.

Now, there are two kinds of implementation for users to make a query.

Example:

The following querying results are both the timeseries number of root.sg1

  1.  The "LEVEL" count from the user specified prefix:
count timeseries root.sg1 group by level=1
  2.  The "LEVEL" count from "root" no matter what users input:
count timeseries root.sg1 group by level=2

If you have any advice, please welcome to discuss with me. I need an 
instruction to make this decision.

Best,
Tsung-Han Tsai
________________________________
寄件者: Jack Tsai <[email protected]>
寄件日期: 2019年9月23日 下午 10:35
收件者: [email protected] <[email protected]>
主旨: 回覆: Add interfaces for querying device or timeseries number

Hi,

I have found the bug inside this querying function which I have initially 
implemented.

I did not consider the path condition that users might defined and all the 
paths start from root. This should be started from the path which has been 
specified. There is an example below:

So far, users could only get the timeseries number and the device number from 
root, which looks like this:

count timeseries root group by level=3

and if users enter

count timeseries root.sg1 group by level=3

Then it will appear the same answer.

For this reason, I will change the underlying implementation of this querying 
interface to improve the users experience.

Best regards,
Tsung-Han Tsai
________________________________
寄件者: Jack Tsai <[email protected]>
寄件日期: 2019年8月23日 下午 04:00
收件者: [email protected] <[email protected]>
主旨: Add interfaces for querying device or timeseries number

Hi,

I have finished the implementation of this improvement as adding interfaces for 
querying device or timeseries number (the corresponding JIRA issue: 
https://issues.apache.org/jira/browse/IOTDB-174).

I have created three sql command for users to done such operations mentioned in 
the issue, which would be shown below.

Let's take a look with an example. There are 8 timeseries under the root, which 
are:
root.vehicle1.d1.s1, root.vehicle1.d1.s2, root.vehicle1.d2.s3, 
root.vehicle1.d2.s4, root.vehicle2.d3.s5, root.vehicle2.d3.s6, 
root.vehicle2.d4.s7, root.vehicle2.d4.s8

  1.  The interface for querying the timeseries number under the specified path.
COUNT TIMESERIES <path>

According to the example above:
COUNT TIMESERIES root

Result:
|Timeseries Num|
|8                           |

  2.  The interface for querying the node number at the given level in current 
Metadata Tree (this could be used to query the number of devices)
COUNT NODES <path> LEVEL=<integer>

According to the example above:
COUNT NODES root LEVEL=3

Result:
|Node Num|
|4                 |

  3.  The interface for querying the timeseries number of each node at the 
given level (this could be used to query the number of sensors under each 
device)
COUNT TIMESERIES <path> GROUP BY LEVEL = <integer>

According to the example above:
COUNT TIMESERIES root GROUP BY LEVEL = 3

Result:
|Node Path        |Node Timeseries Num|
|root.vehicle.d1|2                                      |
|root.vehicle.d2|2                                      |
|root.vehicle.d3|2                                      |
|root.vehicle.d4|2                                      |

These three interfaces could provide users more query options.

Best regards,
Tsung-Han Tsai

Reply via email to