Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

前缀路径聚合问题 #152

Open
stefaniexin opened this issue Nov 30, 2017 · 3 comments
Open

前缀路径聚合问题 #152

stefaniexin opened this issue Nov 30, 2017 · 3 comments
Assignees
Labels

Comments

@stefaniexin
Copy link
Contributor

stefaniexin commented Nov 30, 2017

IoTDB> select * from root
+-----------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+
|                   Time|root.turbine.Shanghai.d2.Energy|root.turbine.Shanghai.d3.Energy| root.turbine.Shanghai.d3.Speed| root.turbine.Beijing.d2.Energy|  root.turbine.Beijing.d2.Speed|
+-----------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+
|2017-12-01T00:22:59.334|                           null|                           null|                           null|                      27.928814|                              1|
|2017-12-01T00:22:59.855|                           null|                           null|                           null|                      25.391584|                              0|
|2017-12-01T00:23:00.269|                           null|                           null|                           null|                      29.979698|                              8|
|2017-12-01T00:23:00.698|                           null|                           null|                           null|                      22.309273|                              3|
|2017-12-01T00:23:01.117|                           null|                           null|                           null|                      29.748756|                             11|
|2017-12-01T00:23:01.539|                           null|                           null|                           null|                      20.662369|                              4|
|2017-12-01T00:23:01.959|                           null|                       23.56449|                              6|                       26.08468|                              4|
|2017-12-01T00:23:02.382|                           null|                      26.359634|                              3|                      20.690254|                              0|
|2017-12-01T00:23:02.795|                           null|                      28.777403|                              8|                      23.677143|                             13|
|2017-12-01T00:23:03.218|                           null|                      27.712833|                              3|                      20.305994|                              5|
|2017-12-01T00:23:03.638|                           null|                      29.470375|                              9|                      22.673237|                              7|
|2017-12-01T00:23:04.060|                           null|                      28.339792|                              0|                      25.473534|                             13|
|2017-12-01T00:23:04.481|                           null|                      20.276184|                              5|                       26.35075|                             10|
|2017-12-01T00:23:04.899|                           null|                      21.032091|                              2|                      22.565153|                              3|
|2017-12-01T00:23:05.317|                           null|                      28.488579|                              1|                      27.924906|                              4|
|2017-12-01T00:23:05.735|                           null|                      28.298925|                              8|                      28.964344|                              7|
|2017-12-01T00:23:06.155|                           null|                       26.81476|                              0|                      25.271076|                              3|
|2017-12-01T00:23:06.575|                           null|                      29.723043|                           null|                      23.091873|                             12|
+-----------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+
record number = 18
execute successfully.
IoTDB> select count(d2) from root.turbine.Shanghai
+-----------------------+--------------------------------------+
|                   Time|count(root.turbine.Shanghai.d2.Energy)|
+-----------------------+--------------------------------------+
+-----------------------+--------------------------------------+
record number = 0
execute successfully.
IoTDB> select count(d3) from root.turbine.Shanghai
+-----------------------+--------------------------------------+--------------------------------------+
|                   Time|count(root.turbine.Shanghai.d3.Energy)| count(root.turbine.Shanghai.d3.Speed)|
+-----------------------+--------------------------------------+--------------------------------------+
+-----------------------+--------------------------------------+--------------------------------------+
record number = 0
execute successfully.
IoTDB> select count(d3) from root.turbine.Shanghai
+-----------------------+--------------------------------------+--------------------------------------+
|                   Time|count(root.turbine.Shanghai.d3.Energy)| count(root.turbine.Shanghai.d3.Speed)|
+-----------------------+--------------------------------------+--------------------------------------+
|1970-01-01T08:00:00.000|                                    12|                                    11|
+-----------------------+--------------------------------------+--------------------------------------+
record number = 1
execute successfully.
IoTDB> select count(d2) from root.turbine.Shanghai
+-----------------------+--------------------------------------+
|                   Time|count(root.turbine.Shanghai.d2.Energy)|
+-----------------------+--------------------------------------+
+-----------------------+--------------------------------------+
record number = 0
execute successfully.
IoTDB> select count(d3) from root.turbine.Shanghai
+-----------------------+--------------------------------------+--------------------------------------+
|                   Time|count(root.turbine.Shanghai.d3.Energy)| count(root.turbine.Shanghai.d3.Speed)|
+-----------------------+--------------------------------------+--------------------------------------+
+-----------------------+--------------------------------------+--------------------------------------+
record number = 0
execute successfully.
IoTDB> select count(d3) from root.turbine.Shanghai
+-----------------------+--------------------------------------+--------------------------------------+
|                   Time|count(root.turbine.Shanghai.d3.Energy)| count(root.turbine.Shanghai.d3.Speed)|
+-----------------------+--------------------------------------+--------------------------------------+
|1970-01-01T08:00:00.000|                                    12|                                    11|
+-----------------------+--------------------------------------+--------------------------------------+
record number = 1
execute successfully.

在count(d2)之后再做count(d3)才会出问题,单独做count(d3)不会出问题。怀疑因为root.turbine.Shanghai.d2.Energy列为空列,所以count出错。所以向其中插入了一条数据。便没有bug了。

IoTDB> select * from root
+-----------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+
|                   Time|root.turbine.Shanghai.d2.Energy|root.turbine.Shanghai.d3.Energy| root.turbine.Shanghai.d3.Speed| root.turbine.Beijing.d2.Energy|  root.turbine.Beijing.d2.Speed|
+-----------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+
|1970-01-01T08:00:12.345|                          -2000|                           null|                           null|                           null|                           null|
|2017-12-01T00:22:59.334|                           null|                           null|                           null|                      27.928814|                              1|
|2017-12-01T00:22:59.855|                           null|                           null|                           null|                      25.391584|                              0|
|2017-12-01T00:23:00.269|                           null|                           null|                           null|                      29.979698|                              8|
|2017-12-01T00:23:00.698|                           null|                           null|                           null|                      22.309273|                              3|
|2017-12-01T00:23:01.117|                           null|                           null|                           null|                      29.748756|                             11|
|2017-12-01T00:23:01.539|                           null|                           null|                           null|                      20.662369|                              4|
|2017-12-01T00:23:01.959|                           null|                       23.56449|                              6|                       26.08468|                              4|
|2017-12-01T00:23:02.382|                           null|                      26.359634|                              3|                      20.690254|                              0|
|2017-12-01T00:23:02.795|                           null|                      28.777403|                              8|                      23.677143|                             13|
|2017-12-01T00:23:03.218|                           null|                      27.712833|                              3|                      20.305994|                              5|
|2017-12-01T00:23:03.638|                           null|                      29.470375|                              9|                      22.673237|                              7|
|2017-12-01T00:23:04.060|                           null|                      28.339792|                              0|                      25.473534|                             13|
|2017-12-01T00:23:04.481|                           null|                      20.276184|                              5|                       26.35075|                             10|
|2017-12-01T00:23:04.899|                           null|                      21.032091|                              2|                      22.565153|                              3|
|2017-12-01T00:23:05.317|                           null|                      28.488579|                              1|                      27.924906|                              4|
|2017-12-01T00:23:05.735|                           null|                      28.298925|                              8|                      28.964344|                              7|
|2017-12-01T00:23:06.155|                           null|                       26.81476|                              0|                      25.271076|                              3|
|2017-12-01T00:23:06.575|                           null|                      29.723043|                           null|                      23.091873|                             12|
+-----------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+
record number = 19
execute successfully.
IoTDB> select count(d2) from root.turbine.Shanghai
+-----------------------+--------------------------------------+
|                   Time|count(root.turbine.Shanghai.d2.Energy)|
+-----------------------+--------------------------------------+
|1970-01-01T08:00:00.000|                                     1|
+-----------------------+--------------------------------------+
record number = 1
execute successfully.
IoTDB> select count(d3) from root.turbine.Shanghai
+-----------------------+--------------------------------------+--------------------------------------+
|                   Time|count(root.turbine.Shanghai.d3.Energy)| count(root.turbine.Shanghai.d3.Speed)|
+-----------------------+--------------------------------------+--------------------------------------+
|1970-01-01T08:00:00.000|                                    12|                                    11|
+-----------------------+--------------------------------------+--------------------------------------+
record number = 1
execute successfully.
@MyXOF
Copy link
Collaborator

MyXOF commented Dec 1, 2017

这个bug已经修复了吗?

@Beyyes
Copy link
Member

Beyyes commented Dec 1, 2017

这个还有些问题,现在不确定对于没有值的列count, max_value到底该输出什么,建议试一下mysql对于没有数据的列max_value, count之类输出什么

@Beyyes
Copy link
Member

Beyyes commented Dec 6, 2017

这个issue对于普通的聚合已经不存在问题。对于group by的某个切割部分来说如果没有数据的话,count也显示0吗?我认为显示null也是可以的。

jixuan1989 pushed a commit that referenced this issue Nov 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants