Hi all,

I'd like to ask for a review of PR #18725:

  https://github.com/apache/iotdb/pull/18725
  "Add LTTB downsampling as a built-in Table Model table function"
  Closes #18532

I have addressed all the review comments received so far. The latest head
is 3660c706.

Summary of the review rounds:

- Duplicate input timestamps within a partition now fail with semantic
  error 701, including duplicates supplied by different regions and
  duplicates whose participant values are NULL (issue point 4).

- Non-finite values (NaN, +/-Infinity) are eligible and are returned, but
  they never serve as triangle vertices A or C. One lookahead rule is now
  shared by target-count and window mode: C averages only the finite
  points of the next bucket that has one, falls back to the last finite
  eligible point, and a bucket without a finite candidate returns its
  earliest point without moving the anchor.

- SIZE mode returns the first and last eligible points as buckets of
  their own, keeps one anchor chain across overlapping windows, and a
  window with no eligible point emits no row, consistent with M4.

- LTTB is excluded from the per-fragment split and runs once over the
  partition inputs merged in order; planner tests assert the resulting
  plan shape (TableFunctionProcessor over MergeSort).

- The buffer budget moved out of udf-api into an engine-internal
  interface, is resolved once per processor provider, and is charged to
  the operator's memory estimate, so a hot reload cannot make the
  reservation and the enforced limit diverge. The configuration is
  documented in iotdb-system.properties.template.

- Added integration coverage for SLIDE, ORIGIN, invalid TIMECOL, and
  duplicate timestamps across devices of one partition, for the direct
  scan and for the window-function and SESSION inputs.

Since the last review, commit 3660c706 additionally fixes a window
emission stall: when a participant column has exactly one eligible point
in the partition, `isReady` compared against the default value of
`lastEligiblePositions` and the first window never became ready, so the
whole partition was buffered and the query failed with the buffer limit
error. Emission now streams in that case. A regression test covers both
count and time windows.

Local verification: the 46 LTTB unit tests in node-commons pass
(LTTBNumericBoundaryTest 15, LTTBRegressionTest 10, LTTBTableFunctionTest
13, LTTBWindowMemoryTest 8), and spotless passes. CI has not run on this
PR yet; a run approval would be appreciated.

Best,
DaZuiZui

Reply via email to