Skip to content

Commit 98a9372

Browse files
feat: Add serialization/deserialization support for Predicates and Expressions (delta-io#1543)
## 🥞 Stacked PR Use this [link](https://github.com/delta-io/delta-kernel-rs/pull/1543/files) to review incremental changes. - [**stack/dlr_serialization_helpers**](delta-io#1543) [[Files changed](https://github.com/delta-io/delta-kernel-rs/pull/1543/files)] - [stack/dlr_serde](delta-io#1503) [[Files changed](https://github.com/delta-io/delta-kernel-rs/pull/1503/files/24f9ac49c8fd3d846fbfd177e0e79f6205586abb..5a19246777bb92a49766105ba7cd6c3f1efd56a6)] - [stack/dlr_add_rm_dedup](delta-io#1537) [[Files changed](https://github.com/delta-io/delta-kernel-rs/pull/1537/files/5a19246777bb92a49766105ba7cd6c3f1efd56a6..ab6f32ca7ede0b27a3c699dc9601d61ad30ddb44)] - [stack/dlr_immutable_add_rm_dedup](delta-io#1538) [[Files changed](https://github.com/delta-io/delta-kernel-rs/pull/1538/files/ab6f32ca7ede0b27a3c699dc9601d61ad30ddb44..db1eac45ce60dc5c126120cfd25e6604c475ae31)] - [stack/dlr_executor](delta-io#1539) [[Files changed](https://github.com/delta-io/delta-kernel-rs/pull/1539/files/db1eac45ce60dc5c126120cfd25e6604c475ae31..30fe3f9201723467eeb166dc2f9a632550291daf)] - [stack/dlr_api](delta-io#1547) [[Files changed](https://github.com/delta-io/delta-kernel-rs/pull/1547/files/30fe3f9201723467eeb166dc2f9a632550291daf..26d21587e52964a519708222523ba75ffe21fe7d)] - [stack/dlr_scan_state_serde](delta-io#1549) [[Files changed](https://github.com/delta-io/delta-kernel-rs/pull/1549/files/26d21587e52964a519708222523ba75ffe21fe7d..9035f876cbb4c2dc9f3d9fedf1d3f772238f66f9)] --------- <!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://github.com/delta-incubator/delta-kernel-rs/blob/main/CONTRIBUTING.md 2. Run `cargo t --all-features --all-targets` to get started testing, and run `cargo fmt`. 3. Ensure you have added or run the appropriate tests for your PR. 4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP] Your PR title ...'. 5. Be sure to keep the PR description updated to reflect all changes. --> This PR adds the ability to serialize/deserialize expressions and predicates using serde. This is used in when transferring state across network boundaries such as in parallel log replay. <!-- PR title formatting: This project uses conventional commits: https://www.conventionalcommits.org/ Each PR corresponds to a commit on the `main` branch, with the title of the PR (typically) being used for the commit message on main. In order to ensure proper formatting in the CHANGELOG please ensure your PR title adheres to the conventional commit specification. Examples: - new feature PR: "feat: new API for snapshot.update()" - bugfix PR: "fix: correctly apply DV in read-table example" --> ## What changes are proposed in this pull request? This PR adds serialization/deserialization to the expressions and predicates. Opaque expressions will fail since kernel cannot know how to serialize/deserialize them. ## How was this change tested? Ensure that serde fails in the presence of opaque expressions.
1 parent 4fe4508 commit 98a9372

4 files changed

Lines changed: 558 additions & 24 deletions

File tree

kernel/src/expressions/column_names.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::iter::Peekable;
77
use std::ops::Deref;
88

99
/// A (possibly nested) column name.
10-
#[derive(Debug, Clone, Default, PartialEq, PartialOrd, Eq, Ord)]
10+
#[derive(Debug, Clone, Default, PartialEq, PartialOrd, Eq, Ord, Serialize, Deserialize)]
1111
pub struct ColumnName {
1212
path: Vec<String>,
1313
}
@@ -449,6 +449,7 @@ macro_rules! __joined_column_expr {
449449
}
450450
#[doc(inline)]
451451
pub use __joined_column_expr as joined_column_expr;
452+
use serde::{Deserialize, Serialize};
452453

453454
#[cfg(test)]
454455
mod test {

0 commit comments

Comments
 (0)