library-udf dprofile UDFs share state across queries (MvAvg/MinMax/Segment/Percentile/Histogram); gap-fill drops the inclusive endTime point
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
The issue identifies six defects across library-udf UDFs and AbstractGapFillOperator, and says unit tests were added in the linked PR. Start by locating those classes and reviewing the tests that reproduce each reported case. Done means each reproduction passes, including overlapping query state, non-finite input, histogram boundaries, and the inclusive endTime gap point.
由索引模型根据 Issue 内容生成。
描述
Verified against current master (536dd7f) by compiling library-udf and executing the real UDF classes through their validate → beforeStart → transform/merge → terminate lifecycle; every item below was reproduced before fixing.
1. UDTFMvAvg computes (new − evicted) / w instead of a sliding mean
windowSum is a local variable of transform(), so it is reset to 0 on every row and never accumulates. With window=3 and inputs 1..5 the UDTF outputs {3=1.0, 4=1.0, 5=1.0} where the sliding mean is {3=2.0, 4=3.0, 5=4.0}.
2. UDTFMinMax desynchronises its timestamps/values tables on non-finite input
In batch mode the timestamp is appended unconditionally while the value is appended only when finite, so a single NaN row shifts every subsequent timestamp/value pair: inputs (1,1.0) (2,NaN) (3,3.0) produce {1=0.0, 2=1.0} instead of {1=0.0, 3=1.0}.
3. UDTFSegment keeps per-query data in a static final List
Every UDTF call gets a fresh instance (UDFManagementService.reflect), but the collected points live in static fields, so two overlapping segment queries clear/corrupt each other: after query B calls beforeStart, query A's terminate emits 0 points instead of its collected 5.
4. UDAFPercentile keeps the exact-count maps in 4 static Maps
Same class of defect: the anonymous PercentileOperations singleton reassigns static state in initialize(), so overlapping percentile queries lose their value→timestamp mapping (exact-mode output timestamps become 0) and the state is not thread-safe.
5. UDTFHistogram bucket computation overflows when min/max are omitted
With default (auto) boundaries end - start can overflow to +Inf, making gap = +Inf and every value fall into bucket 0: inputs 1..10 with count=10 produce {0=10} instead of a 10-bucket histogram. A value equal to max also maps to NaN → bucket 0.
6. AbstractGapFillOperator drops the gap point at an inclusive endTime
The terminal fill guard at hasRemainingGapInPreviousGroup() uses currentTime < endTime, while group switching (<=) and fillGaps treat endTime as inclusive (the constructor documents "end time(inclusive)" and the existing tests expect the endpoint row). With start=0, end=10, step=2 and the last real row at t=8, the gap row at t=10 is never emitted. Fixing the comparison to <= restores it.
All six are fixed in the linked PR with unit tests (the MvAvg and gap-fill fixes were additionally verified by temporarily reverting the source change and observing the new tests fail, then re-applying).
- 主要语言
- Java
- 星标
- 6.4k
- 派生
- 1.2k
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 284
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/iotdb 的其他 Issue
-
[Bug] Python NumpyTablet silently drops trailing zero bytes from BLOB values可能已有人在做 @DaZuiZui 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
[Bug] sbin/replace-conf-from-env.sh word-splits the whole environment and corrupts iotdb-system.properties可能已有人在做 @anishmehta24 于 69 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
apache/iotdb#18655 · 1 个 reaction ·
维护者通常 1 天内回复
-
IoTDB Edge: stop-edge.sh does not stop its own process when IOTDB_HOME is set, and reports success可能已有人在做 @PDGGK 于 88 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
[Bug] findColumn throws NullPointerException instead of SQLException for an unknown column name可能已有人在做 @PDGGK 于 130 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
openhab/openhab-addons#22512 ·
维护者通常 1 天内回复
-
help wanted maintenance
难度 2/5 1-3 小时 新手友好度 84/100
apache/maven-project-info-reports-plugin#704 ·
维护者通常 1 天内回复
-
help wanted maintenance
难度 2/5 1-3 小时 新手友好度 78/100
apache/maven-ejb-plugin#261 ·
维护者通常 1 天内回复
-
help wanted maintenance
难度 2/5 1-3 小时 新手友好度 78/100
apache/maven-archetype#1086 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复