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 2021/04/24 14:22:14 UTC

[GitHub] [iotdb] mzp0514 opened a new issue #3058: Wrong result when applying aggregation function on series with * and where clause

mzp0514 opened a new issue #3058:
URL: https://github.com/apache/iotdb/issues/3058


   There is an error with the result of aggregation on series with * and where clause.
   
   Data:
   
   <img width="519" alt="截屏2021-04-24 下午10 17 23" src="https://user-images.githubusercontent.com/34649843/115961856-e39fdd80-a54a-11eb-926a-ab5db21db6f6.png">
   
   Select result:
   
   <img width="1161" alt="截屏2021-04-24 下午10 10 32" src="https://user-images.githubusercontent.com/34649843/115961786-7ee48300-a54a-11eb-889a-fb6f3ffbed54.png">
   
   <img width="1229" alt="截屏2021-04-24 下午10 10 09" src="https://user-images.githubusercontent.com/34649843/115961765-67a59580-a54a-11eb-8e15-4b31f4c69408.png">
   
   The value of count(root.ln.wf02.wt02.temperature) should be 21 but it turns out to be 5 according to result of the `select count(temperature) from root.ln.*.* where temperature > 50.0`. The error also happened with regard to the `avg` function.
   


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] jixuan1989 commented on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
jixuan1989 commented on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-838382386


   I think we need to discuss which semantic is more general, "and" or
   "respectively"?
   (seems "respectively" is more suitable if we compare with other TSDBs).
   
   mzp0514 ***@***.***> 于2021年5月11日周二 下午6:42写道:
   
   > It's not a bug i think.
   > select temperature from root.ln.*.* where temperature > 50 means
   > select root.ln.*.*.temperature ... where root.ln.*.*.temperature > 50.
   >
   > Therefore, root.ln.wf01.wt01.temperature, root.ln.wf01.wt02.temperature,
   > root.ln.wf02.wt01.temperature, root.ln.wf02.wt02.temperature will be
   > considered at the same time.
   >
   > If you want to take just root.ln.wf02.wt02 as filter, write sql like this:
   > select temperature from root.ln.*.* where root.ln.wf02.wt02.temperature >
   > 50
   >
   > I see... It seems that there is not an approach to selecting the count of
   > data points whose value > 50 of *each* timeseries *respectively* in *one*
   > sql?
   >
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/iotdb/issues/3058#issuecomment-838249969>, or
   > unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AAHZOVXOFUHSRWNT33SBTILTNECZZANCNFSM43QGD3HA>
   > .
   >
   


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] Alima777 edited a comment on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
Alima777 edited a comment on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-839587801


   > It seems that there is not an approach to selecting the count of data points whose value > 50 of each timeseries respectively in one sql?
   
   As far as I know, you are right.
   
   Maybe you can try `select temperature from root.ln.*.* where temperature > 50 align by device`.
   
   `Align by device` will process the measurement and filter by each device respectively, the sql above will be turned to four sub-query and concat the result finally:
   
   `select temperature from root.ln.wf01.wt01  where temperature > 50` 
   `select temperature from root.ln.wf01.wt02  where temperature > 50` 
   `select temperature from root.ln.wf02.wt01  where temperature > 50` 
   `select temperature from root.ln.wf02.wt02  where temperature > 50` 
   
   But it uses the relation table structure, which is different from ordinary query.


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] mzp0514 commented on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
mzp0514 commented on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-826252106


   > ![image](https://user-images.githubusercontent.com/35786966/115980183-1c789a80-a5bd-11eb-885e-15f8229e837c.png)
   > i just do what you do, but i can't find this wrong
   > update your iotdb version and try again
   
   I have updated my iotdb code to the latest version lol. It seems that you do not have data in root.ln.wf01.wt01.temperature, root.ln.wf01.wt02.temperature, root.ln.wf02.wt01.temperature? I initialize my data in this way and have 4 time series:
   
   <img width="1369" alt="截屏2021-04-25 下午12 12 09" src="https://user-images.githubusercontent.com/34649843/115980464-85611200-a5bf-11eb-9ae0-501be839faae.png">
   
   
   


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] github-actions[bot] commented on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-826100463


   Hi, this is your first issue in IoTDB project. Thanks for your report. Welcome to join the community!


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] Alima777 commented on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
Alima777 commented on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-836607286


   It's not a bug i think.
   'select temperature from root.ln.*.* where temperature > 50' means 
   select root.ln.*.*.temperature ... where root.ln.*.*.temperature > 50.
   
   Therefore,  root.ln.wf01.wt01.temperature,  root.ln.wf01.wt02.temperature, root.ln.wf02.wt01.temperature,  root.ln.wf02.wt02.temperature will be considered at the same time.
   
   If you want to take just root.ln.wf02.wt02 as filter, write sql like this:
   select temperature from root.ln.*.* where root.ln.wf02.wt02.temperature > 50
   


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] mzp0514 commented on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
mzp0514 commented on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-826252106


   > ![image](https://user-images.githubusercontent.com/35786966/115980183-1c789a80-a5bd-11eb-885e-15f8229e837c.png)
   > i just do what you do, but i can't find this wrong
   > update your iotdb version and try again
   
   I have updated my iotdb code to the latest version lol. It seems that you do not have data in root.ln.wf01.wt01.temperature, root.ln.wf01.wt02.temperature, root.ln.wf02.wt01.temperature? I initialize my data in this way and have 4 time series:
   
   <img width="1369" alt="截屏2021-04-25 下午12 12 09" src="https://user-images.githubusercontent.com/34649843/115980464-85611200-a5bf-11eb-9ae0-501be839faae.png">
   
   
   


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] Superainbower commented on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
Superainbower commented on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-826249133


   ![image](https://user-images.githubusercontent.com/35786966/115980183-1c789a80-a5bd-11eb-885e-15f8229e837c.png)
   i just do what you do, but i can't find this wrong
   update your iotdb version and try again


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] Alima777 commented on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
Alima777 commented on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-839587801


   > It seems that there is not an approach to selecting the count of data points whose value > 50 of each timeseries respectively in one sql?
   As far as I know, you are right.
   
   Maybe you can try `select temperature from root.ln.*.* where temperature > 50 align by device`.
   
   `Align by device` will process the measurement and filter by each device respectively, the sql above will be turned to four sub-query and concat the result finally:
   
   `select temperature from root.ln.wf01.wt01  where temperature > 50` 
   `select temperature from root.ln.wf01.wt02  where temperature > 50` 
   `select temperature from root.ln.wf02.wt01  where temperature > 50` 
   `select temperature from root.ln.wf02.wt02  where temperature > 50` 
   
   But it uses the relation table structure, which is different from ordinary query.


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] Alima777 edited a comment on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
Alima777 edited a comment on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-836607286


   It's not a bug i think.
   `select temperature from root.ln.*.* where temperature > 50` means 
   select `root.ln.*.*.temperature` ... where `root.ln.*.*.temperature` > 50.
   
   Therefore,  root.ln.wf01.wt01.temperature,  root.ln.wf01.wt02.temperature, root.ln.wf02.wt01.temperature,  root.ln.wf02.wt02.temperature will be considered at the same time.
   
   If you want to take just root.ln.wf02.wt02 as filter, write sql like this:
   select temperature from root.ln.*.* where root.ln.wf02.wt02.temperature > 50
   


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] mzp0514 commented on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
mzp0514 commented on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-838249969


   > It's not a bug i think.
   > `select temperature from root.ln.*.* where temperature > 50` means
   > select `root.ln.*.*.temperature` ... where `root.ln.*.*.temperature` > 50.
   > 
   > Therefore, root.ln.wf01.wt01.temperature, root.ln.wf01.wt02.temperature, root.ln.wf02.wt01.temperature, root.ln.wf02.wt02.temperature will be considered at the same time.
   > 
   > If you want to take just root.ln.wf02.wt02 as filter, write sql like this:
   > `select temperature from root.ln.*.* where root.ln.wf02.wt02.temperature > 50`
   
   I see... It seems that there is not an approach to selecting the count of data points whose value > 50 of **each** timeseries **respectively** in **one** sql?


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] Alima777 edited a comment on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
Alima777 edited a comment on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-836607286


   It's not a bug i think.
   `select temperature from root.ln.*.* where temperature > 50` means 
   select `root.ln.*.*.temperature` ... where `root.ln.*.*.temperature` > 50.
   
   Therefore,  root.ln.wf01.wt01.temperature,  root.ln.wf01.wt02.temperature, root.ln.wf02.wt01.temperature,  root.ln.wf02.wt02.temperature will be considered at the same time.
   
   If you want to take just root.ln.wf02.wt02 as filter, write sql like this:
   `select temperature from root.ln.*.* where root.ln.wf02.wt02.temperature > 50`
   


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] Superainbower commented on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
Superainbower commented on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-826472585


   you are right, it seems bug


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] github-actions[bot] commented on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-826100463


   Hi, this is your first issue in IoTDB project. Thanks for your report. Welcome to join the community!


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] Superainbower commented on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
Superainbower commented on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-826249133






-- 
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:
users@infra.apache.org



[GitHub] [iotdb] mzp0514 edited a comment on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
mzp0514 edited a comment on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-826252106


   > ![image](https://user-images.githubusercontent.com/35786966/115980183-1c789a80-a5bd-11eb-885e-15f8229e837c.png)
   > i just do what you do, but i can't find this wrong
   > update your iotdb version and try again
   
   I have updated my iotdb code to the latest version lol. It seems that you do not have data in root.ln.wf01.wt01.temperature, root.ln.wf01.wt02.temperature, root.ln.wf02.wt01.temperature? I initialize my data in this way and have 4 time series:
   
   <img width="1369" alt="截屏2021-04-25 下午12 12 09" src="https://user-images.githubusercontent.com/34649843/115980464-85611200-a5bf-11eb-9ae0-501be839faae.png">
   
   
   (i = 0, 1,  j = 0, 1)


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] mzp0514 edited a comment on issue #3058: Wrong result when applying aggregation function on series with * and where clause

Posted by GitBox <gi...@apache.org>.
mzp0514 edited a comment on issue #3058:
URL: https://github.com/apache/iotdb/issues/3058#issuecomment-826252106


   > ![image](https://user-images.githubusercontent.com/35786966/115980183-1c789a80-a5bd-11eb-885e-15f8229e837c.png)
   > i just do what you do, but i can't find this wrong
   > update your iotdb version and try again
   
   I have updated my iotdb code to the latest version lol. It seems that you do not have data in root.ln.wf01.wt01.temperature, root.ln.wf01.wt02.temperature, root.ln.wf02.wt01.temperature? I initialize my data in this way and have 4 time series:
   
   <img width="1369" alt="截屏2021-04-25 下午12 12 09" src="https://user-images.githubusercontent.com/34649843/115980464-85611200-a5bf-11eb-9ae0-501be839faae.png">
   
   
   (i = 0, 1,  j = 0, 1)


-- 
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:
users@infra.apache.org