[ 
https://issues.apache.org/jira/browse/IOTDB-622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17094083#comment-17094083
 ] 

Xiangdong Huang commented on IOTDB-622:
---------------------------------------

Hi,

Maybe, we can support more...

 

Let's see an example,

suppose we have a table:

name: table1

| country | carID | s1| timestamp|

in which (country, carID, timestamp) is the primary key.

 

In IoTDB, we can define paths like root.table.some_country.some_carID.

 

We all know in RDB, we can write SQLs like:
 * 1. select count (s1) from table1
 * 2. select count (s1) from table1 group by country
 * 3. select count (s1) from table1 group by carID
 * 4. select count (s1) from table1 group by country,carID

 

If we have only "IN TOTAL" keyword, then it matches the RDB-SQL1.

If, we want to support RDB-SQL2 and 3, how about add some other keyword in 
"group by" statement.

e.g.,
 * SQL1 -> "select count (s1) from root group by (1m, [start time, end time)), 
level N"  
 * SQL2 -> "select count (s1) from root group by (1m, [start time, end time)), 
level 3"
 * SQL3 -> "select count (s1) from root group by (1m, [start time, end time)), 
level 4"
 * SQL4 -> "select count (s1) from root group by (1m, [start time, end time)), 
level 1"

 

So, the grammar is :

SELECT ... 

FROM ...

GROUP BY  time_interval |  LEVEL n | time_interval, LEVEL n.

where "level n" means the N-th level of the time series path.

if there is no "level" specified, n =INT.MAX, which means group by each 
timeseries;

if there is no "time_interval", which means do not downsampling data;

if n > the max level in a given path set, then n = the max level in the given 
path set.

 

 

 

 

 

> count all records of the whole database
> ---------------------------------------
>
>                 Key: IOTDB-622
>                 URL: https://issues.apache.org/jira/browse/IOTDB-622
>             Project: Apache IoTDB
>          Issue Type: Improvement
>          Components: Core/Engine
>            Reporter: WangChao
>            Assignee: WangChao
>            Priority: Trivial
>
> Now the count function only count the number of every timeseries, it's useful 
> to  count the total record of the  specific path.
>  
> like:
>  
> *_select count(*) from root.ln._**  should return the total number of the 
> records in storage group root.ln, but now it returns the number of each 
> timeseries which is in root.ln.
>  
> Please leave your opinion. 
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to