-
Notifications
You must be signed in to change notification settings - Fork 590
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(iceberg): reduce iceberg catalog fetch rpc number for iceberg scan #17939
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
#[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] | ||
pub struct IcebergFileScanTaskJsonStr(String); | ||
|
||
impl IcebergFileScanTaskJsonStr { | ||
pub fn deserialize(&self) -> FileScanTask { | ||
serde_json::from_str(&self.0).unwrap() | ||
} | ||
|
||
pub fn serialize(task: &FileScanTask) -> Self { | ||
Self(serde_json::to_string(task).unwrap()) | ||
} | ||
} | ||
|
||
#[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] | ||
pub struct TableMetadataJsonStr(String); | ||
|
||
impl TableMetadataJsonStr { | ||
pub fn deserialize(&self) -> TableMetadata { | ||
serde_json::from_str(&self.0).unwrap() | ||
} | ||
|
||
pub fn serialize(metadata: &TableMetadata) -> Self { | ||
Self(serde_json::to_string(metadata).unwrap()) | ||
} | ||
} | ||
|
||
#[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] | ||
pub struct IcebergSplit { | ||
pub split_id: i64, | ||
pub snapshot_id: i64, | ||
pub files: Vec<String>, | ||
pub table_meta: TableMetadataJsonStr, | ||
pub files: Vec<IcebergFileScanTaskJsonStr>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to serialize them as JSON str, instead of serialize directly?
BTW, for serializing as JSON str, a better way is to #[serde_as(as = "JsonString")]
https://docs.rs/serde_with/latest/serde_with/json/struct.JsonString.html
(So we still have deserialized representation in memory)
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.