Caideyipi commented on PR #17871: URL: https://github.com/apache/iotdb/pull/17871#issuecomment-6852598639
Completed one independent re-review of the full 86-file diff and relevant context. This round found and fixed one P2 behavioral issue. The PR remains **Draft** pending a fresh independent re-review. - Reviewed SHA: `8c37cb0e5e083759420ae840558064b500db35ab`. - Fixed comparison baseline: `cca1dbbde6d0dffa38495c92c92a48b2626d2f99`. - Final local SHA, confirmed `Caideyipi/iotdb:fix/library-udf-edge-cases` head, and confirmed PR head: **all `49816e970fe1f5df80f2b762e56b213703272005`**. - Immediately before pushing, both remote heads still matched the reviewed SHA and the PR was Draft. The update was a fast-forward protected by an explicit lease against that SHA; no concurrent update was overwritten. **P2 — fixed: preserve dense Spline knots across a wide timestamp range.** At the reviewed revision, [UDTFSpline.java:97–113](https://github.com/apache/iotdb/blob/8c37cb0e5e083759420ae840558064b500db35ab/library-udf/src/main/java/org/apache/iotdb/library/dprofile/UDTFSpline.java#L97-L113) always centered double coordinates at the time-range midpoint. Valid timestamps `[0, 1, 2, 3, 4, 2^60]`, values `t / 2^60`, and `points=3` collapsed to fewer than five coordinates and produced no output. Expected timestamps were `[0, 2^59, 2^60]`, with values `[0, 0.5, 1]`. A regression failed against the reviewed production source in a clean source reactor. The [repair](https://github.com/apache/iotdb/blob/49816e970fe1f5df80f2b762e56b213703272005/library-udf/src/main/java/org/apache/iotdb/library/dprofile/UDTFSpline.java#L142-L215) chooses among midpoint/start/end origins to retain the most distinct coordinates. The mirrored right-end regression also caught cancellation yielding NaN in Akima's three-point endpoint derivatives during repair validation. The final implementation uses equivalent divided differences for those derivatives, retaining Akima's interior weights and Hermite cubics. [Regression coverage](https://github.com/apache/iotdb/blob/49816e970fe1f5df80f2b762e56b213703272005/library-udf/src/test/java/org/apache/iotdb/library/UDFWindowAndQueueTest.java#L2423-L2472) asserts timestamps and linear values for dense left/right/interior clusters, plus independently fixed expected values for a non-linear Akima example. The review also covered MAD merging/isNull/INT64 extrema; sampling with reused Rows and INT64 precision; DWT levels; Histogram/MinMax extrema; Spline rounding/endpoints/duplicate timestamps and test doubles; AR/DTW parameter validation; moving-average overflow recovery and compensated summation; and valid-window LOF tests. No additional actionable PR regression was confirmed. The earlier Histogram subnormal-boundary fix, DTW non-increasing-timestamp cache invalidation, and moving-average exact-sum recovery are present. The pre-existing LOF numerical-semantics audit candidate remains unconfirmed as a PR regression, and its algorithm was left unchanged. DTW inspection covered historical and cross-shard matching, interleaved/reversed/multi-level merges, deferred reconstruction, serialization, continued input, and repeated output. Static resource assessment: with `N` retained input points, `R` matches, and template length `L`, state grows as `O(N + R)`; serialized state uses `9 + 16N + 20R` bytes, excluding temporary allocations and heap-object overhead. Merge generally costs `O(M log(N + M))` for `M` incoming points and defers DTW reconstruction until output. A dirty output can rebuild in `O(N * L^2)` time with `O(L)` DTW scratch space; unchanged repeated output reuses cached matches. Repeated merge/output cycles can repeat that reconstruction cost. Complete input retention therefore continues to grow with history; no performance benchmark was run. Validation used the authorized local offline fallback, with both local and remote Develocity build caches disabled and the required IoTDB dependency closure rebuilt from clean source: - `mvn -o clean test -pl library-udf -am`: **144 tests passed**, zero failures/errors/skips, all 56 goals executed. - After adding the non-linear expected-value regression, a separate clean source reactor selecting that new test passed: **1 test**, all 56 goals executed. Thus all **145 distinct tests**, including every newly added test, were run locally and passed across these runs; the final 145-test suite was not rerun as one invocation. - `mvn -o clean test-compile -pl library-udf -am -P with-zh-locale -DskipTests`: passed, all 54 goals executed. - Spotless apply/check, Checkstyle, locale message-key parity, and `git diff --check`: passed. No full-project build or performance benchmark was run. CI was neither waited for nor polled. This session ends after repair/publication; it does not include a second review round. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
