QuakeWang opened a new issue, #154: URL: https://github.com/apache/paimon-rust/issues/154
### Search before asking - [x] I searched in the [issues](https://github.com/apache/paimon-rust/issues) and found nothing similar. ### Motivation Predicate pushdown requires a reusable filter representation that can be shared by partition pruning, manifest statistics pruning, and data file statistics pruning. This issue adds the foundational predicate types and field-mapping utilities with no behavior change in the read path. ### Solution Add the following types to a new `crates/paimon/src/spec/predicate.rs` module: - `Datum` — typed literal enum covering all Paimon partition-supported types (Bool, Int, Long, String, Date, Timestamp, Decimal, etc.) - `PredicateOperator` — IsNull, IsNotNull, Eq, NotEq, Lt, LtEq, Gt, GtEq, In, NotIn - `Predicate` — filter tree enum with `Leaf` (carrying column name, table schema index, `DataType`, operator, and literals), `And`, `Or`, `Not`, `AlwaysTrue`, `AlwaysFalse` - `PredicateBuilder` — stores schema metadata, validates column references in builder methods (`equal()`, `less_than()`, etc.) - `field_idx_to_partition_idx()` — maps table schema indices to partition row indices (`Vec<Option<usize>>`) - Predicate composition helpers: `and()`, `or()`, `not()` with auto-flattening Key design choice: `Leaf` carries both `index` (table schema position) and `data_type` because partition `BinaryRow` uses a separate index space and value extraction requires knowing the type. The mapping from table schema index to partition row index is handled by `field_idx_to_partition_idx()`. ### Anything else? None ### 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
