Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial table features implementation #1796

Merged
merged 15 commits into from
Nov 3, 2023

Conversation

hntd187
Copy link
Collaborator

@hntd187 hntd187 commented Nov 2, 2023

Description

Hi again, this is table features again, but albeit with less work done on the main branch like the smart guy I am.

Related Issue(s)

#1755 prior review and information

Documentation

https://delta.io/blog/2023-07-27-delta-lake-table-features/
https://github.com/delta-io/delta/blob/master/PROTOCOL.md#table-features

hntd187 and others added 12 commits October 22, 2023 12:19
# Conflicts:
#	rust/src/operations/create.rs
#	rust/src/operations/restore.rs
#	rust/src/operations/transaction/test_utils.rs
#	rust/src/protocol/checkpoints.rs
#	rust/src/protocol/mod.rs
#	rust/src/protocol/parquet2_read/mod.rs
#	rust/src/protocol/parquet_read/mod.rs
#	rust/src/table/mod.rs
#	rust/src/table/state.rs
V2_CHECKPOINT,
/// If we do not match any other reader features
#[serde(other)]
OTHER,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we capture this value using an untagged variant instead?

Something like this

#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
pub enum Example {
    Foo,
    Bar,
    #[serde(untagged)]
    Unknown(String),
}

#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
struct Features {
    reader: Vec<Example>
}

fn main() {
    let features = Features { 
        reader: vec![Example::Foo, Example::Bar, Example::Unknown("Hello".to_string())],
    };
    println!("{}", serde_json::to_string(&features).unwrap());
    let features: Features = serde_json::from_str(r#"{"reader":["Foo","Bar","Hello"]}"#).unwrap();
    println!("{:#?}", features);
}

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ef8134eeaf36d87ca8fbb38b57d18765

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually read my mind, I like this more than other.

wjones127
wjones127 previously approved these changes Nov 2, 2023
@wjones127 wjones127 enabled auto-merge (squash) November 2, 2023 20:03
auto-merge was automatically disabled November 2, 2023 21:16

Head branch was pushed to by a user without write access

@wjones127 wjones127 merged commit 94c1188 into delta-io:main Nov 3, 2023
42 checks passed
natinimni pushed a commit to natinimni/delta-rs that referenced this pull request Jan 31, 2024
# Description
Hi again, this is table features again, but albeit with less work done
on the main branch like the smart guy I am.

# Related Issue(s)
delta-io#1755 prior review and information

# Documentation
https://delta.io/blog/2023-07-27-delta-lake-table-features/
https://github.com/delta-io/delta/blob/master/PROTOCOL.md#table-features

---------

Co-authored-by: Stephen Carman <stephen.carman@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants