You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "naivedogger (via GitHub)" <gi...@apache.org> on 2026/08/18 12:12:16 UTC

[I] [c++] Create C++ bindings for log predicate pushdown [fluss]

naivedogger opened a new issue, #4035:
URL: https://github.com/apache/fluss/issues/4035

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/fluss/issues) and found nothing similar.
   
   
   ### Description
   
   ### Motivation
   
   The Rust client supports predicate pushdown through `TableScan::filter()`, allowing the Fluss server to prune Arrow log RecordBatches using column statistics.
   
   However, the C++ binding does not expose the predicate model or a filter API Currently. Native C++ consumers therefore cannot use this capability and must fetch log batches without filter-based pruning.
   
   The C++ binding should provide predicate semantics consistent with the Rust client. This also enables native integrations such as StarRocks to use predicate pushdown without going through JNI.
   
   This work builds on #3971.
   
   ### Solution
   
   Expose typed predicate builders and add `TableScan::Filter()` to the C++ binding.
   
   Example:
   
   ```cpp
   fluss::LogScanner scanner;
   
   auto predicate =
           fluss::Col("amount")
                   .GreaterOrEqual(100)
                   .And(fluss::Col("region").In({"CN", "SG"}));
   
   auto result = table.NewScan()
                         .Filter(std::move(predicate))
                         .ProjectByName({"order_id", "amount"})
                         .CreateRecordBatchLogScanner(scanner);
   ```
   
   The C++ API should support:
   
   - comparison predicates: `=`, `!=`, `<`, `<=`, `>`, and `>=`;
   - `IS NULL` and `IS NOT NULL`;
   - `IN` and `NOT IN`;
   - string prefix, infix, and suffix predicates;
   - `AND` and `OR`;
   - scalar literal types supported by the Rust predicate model;
   - predicate pushdown together with column projection.
   
   The C++ predicate tree will be passed through the FFI and reconstructed as a Rust Core `Predicate`. The Rust client remains responsible for schema validation and protocol encoding through `TableScan::filter()`.
   
   Filters should be rejected by scanners that do not support predicate pushdown rather than being silently ignored.
   
   Predicate pushdown is conservative and operates at RecordBatch level. Returned batches may still contain non-matching rows, so callers must retain and evaluate the original predicate as a residual filter.
   
   This feature is limited to Arrow log scans. Row-level filtering, primary-key lookup, lake reads, and UnionRead are outside the scope of this issue.
   
   ### Anything else?
   
   The change should include C++ integration tests covering predicate pushdown with projection, invalid filter columns, and unsupported scanner types. The C++ API reference and log-table examples should also be updated.
   
   ### Willingness to contribute
   
   - [x] I'm willing to submit a PR!


-- 
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: issues-unsubscribe@fluss.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [c++] Create C++ bindings for log filter pushdown [fluss]

Posted by "fresh-borzoni (via GitHub)" <gi...@apache.org>.
fresh-borzoni closed issue #4035: [c++] Create C++ bindings for log filter pushdown
URL: https://github.com/apache/fluss/issues/4035


-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org