Hi all,

TsFile's C++ table queries now support FIELD predicates. Previously the
field_filter argument was silently ignored; PR #1026
(https://github.com/apache/tsfile/pull/1026), merged into develop on
2026-10-27 (commit 0d42092c), applies the predicate to aligned rows,
including NULL rows before OFFSET/LIMIT.

What's new:

- AlignedFieldFilter: typed columnar predicates (EQ/NE/LT/LE/GT/GE,
  is_null/is_not_null, and/or/not), evaluated as batch operations with
  page-statistics pruning, filter-column-first decoding, per-page bitmasks
  and bulk copy. Filter-only columns are loaded automatically.

- TableFieldFilter::satisfy_row() for custom per-row predicates; legacy
  Filter keeps working for a single projected FIELD.

- Non-aligned sources keep the row-based path.

Verification: around 216 new tests, CI green on Linux (ASan/LSan), macOS,
Windows and MSVC.

Quick performance check (local, synthetic: 5M rows, 4 devices, 4 INT64
fields, PLAIN / UNCOMPRESSED, warm cache, median of 7 runs):

case                             matched     time
no-filter (baseline)             5,000,000   47.6 ms
a > -1 (all rows match)          5,000,000   59.9 ms
a > rows/2 (~50%)                2,499,999   31.1 ms
a > rows-1000 (~0.1%)                  999    1.3 ms
a > rows (~0%)                           0    1.1 ms
NOT (a > rows-1000)              4,999,001   60.0 ms
a > rows/2 AND b > rows/2 (~25%) 1,249,999   15.7 ms

Selective predicates prune pages and skip output decoding, so they get
much cheaper; a predicate matching every row costs about 25% more than an
unfiltered scan.

Feedback and follow-up tuning are welcome.

Best regards,
Colinlee

Reply via email to