iotdb
iotdb copied to clipboard
浮点数显示位数在merge和flush前后不一致
问题描述: 当前对于浮点数精度的控制是仅针对写入磁盘的非overflow数据设置的。因此会在flush和merge前后造成显示的浮点数位数不一致的情况。容易让用户产生疑惑。
解决方案: 在客户端中加入显示位数的控制(例如使用round方法指定),用户可以自行指定显示位数。在不指定时需要有一个默认值(例如两位),对位数超过默认值的浮点数据进行四舍五入的显示,对位数小鱼默认值的浮点数补零。
复现语句:
IoTDB> set storage group to root.ln
execute successfully.
IoTDB> create timeseries root.ln.wf01.wt01.temperature with datatype=FLOAT,encoding=RLE
execute successfully.
IoTDB> insert into root.ln.wf01.wt01(timestamp,temperature) values(1509465660000,24.359503)
execute successfully.
IoTDB> select * from root
+-----------------------+-----------------------------+
| Time|root.ln.wf01.wt01.temperature|
+-----------------------+-----------------------------+
|2017-11-01T00:01:00.000| 24.359503|
+-----------------------+-----------------------------+
record number = 1
execute successfully.
IoTDB> insert into root.ln.wf01.wt01(timestamp,temperature) values(1509465600000,25.957603)
execute successfully.
IoTDB> select * from root
+-----------------------+-----------------------------+
| Time|root.ln.wf01.wt01.temperature|
+-----------------------+-----------------------------+
|2017-11-01T00:00:00.000| 25.957603|
|2017-11-01T00:01:00.000| 24.359503|
+-----------------------+-----------------------------+
record number = 2
execute successfully.
IoTDB> flush
execute successfully.
IoTDB> select * from root
+-----------------------+-----------------------------+
| Time|root.ln.wf01.wt01.temperature|
+-----------------------+-----------------------------+
|2017-11-01T00:00:00.000| 25.957603|
|2017-11-01T00:01:00.000| 24.36|
+-----------------------+-----------------------------+
record number = 2
execute successfully.
IoTDB> merge
execute successfully.
IoTDB> select * from root
+-----------------------+-----------------------------+
| Time|root.ln.wf01.wt01.temperature|
+-----------------------+-----------------------------+
|2017-11-01T00:00:00.000| 25.96|
|2017-11-01T00:01:00.000| 24.36|
+-----------------------+-----------------------------+
record number = 2
execute successfully.