apache / apache/iotdb

[Bug] In version 1.3.3 of IoTDB, The trend calculation function DIFF does not correctly handle the non-ignore null-value attribute.

未关闭
#14,525 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
6.4k
派生
1.2k
平均合并
1 天 23 小时
30 天内合并 PR
115

描述

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.

### Version

version 1.3.3 (Build: ad95a7e)

### Describe the bug and provide the minimal reproduce step

```
DROP DATABASE root.db0.t1
CREATE DATABASE root.db0.t1

CREATE TIMESERIES root.db0.t1.c0 WITH datatype=INT32;
INSERT INTO root.db0.t1(timestamp, c0) VALUES (1641024000000, 0), (1641024005000, null), (1641024010000, 2), (1641024015000, 3), (1641024020000, null);
CREATE TIMESERIES root.db0.t1.c1 WITH datatype=INT32;
INSERT INTO root.db0.t1(timestamp, c1) VALUES (1641024000000, 0), (1641024005000, 1), (1641024010000, 2), (1641024015000, 3), (1641024020000, 4);

# query 1
select DIFF(c0) from root.db0.t1;

# query 2
select DIFF(c0, 'ignoreNull'='false') from root.db0.t1;
```

### What did you expect to see?

The expected result set for Query 1 is: **null, 2, 1**

The expected result set for Query 2 is: **null, null, null, 1, null**

### What did you see instead?

The actual result set returned by Query 1 is: **null, 2, 1**

The actual result set returned by Query 2 is: **null, 2, 1**

### Anything else?

Dear IoTDB team, In the above trend calculation function queries, Query 1 uses the `DIFF` function with the **ignore null-value** attribute enabled, while Query 2 has it disabled. However, the results returned by Query 2 indicate that null-value data was not included in the trend calculation, which does not meet expectations.

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

贡献指南

打开贡献指南

调研方向

首先针对 IoTDB 1.3.3 运行 DIFF 的最小复现查询,并定位 DIFF 函数的实现及其现有测试。比较启用和禁用 ignoreNull 时的行为;完成标准是 Query 2 返回 null, null, null, 1, null,而 Query 1 仍返回 null, 2, 1。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, sql
领域
databases
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。