-
Notifications
You must be signed in to change notification settings - Fork 285
refactor: Add read_from()
and write_to()
to TableMetadata
#1523
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
base: main
Are you sure you want to change the base?
Conversation
TableMetadataIO
to read and write metadataread()
and write()
to TableMetadata
crates/catalog/glue/src/catalog.rs
Outdated
.new_output(&metadata_location)? | ||
.write(serde_json::to_vec(&metadata)?.into()) | ||
.await?; | ||
TableMetadata::write(&self.file_io, &metadata, &metadata_location).await?; |
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.
I also found MetadataLocation
proposed here quite interesting:
Would love to hear more thoughts about it
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.
I think this should not change the interface here. We could change the write interface to sth like following:
fn write(&self, impl ToString)
to generalize the arguments.
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.
I changed it to
fn write(&self, impl AsRef<str>)
because file_io.new_input/new_output
takes AsRef<str>
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.
Thanks @CTTY for this pr, generally LGTM! Just one minor nit!
crates/catalog/glue/src/catalog.rs
Outdated
.new_output(&metadata_location)? | ||
.write(serde_json::to_vec(&metadata)?.into()) | ||
.await?; | ||
TableMetadata::write(&self.file_io, &metadata, &metadata_location).await?; |
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.
I think this should not change the interface here. We could change the write interface to sth like following:
fn write(&self, impl ToString)
to generalize the arguments.
read()
and write()
to TableMetadata
read_from()
and write_to()
to TableMetadata
Which issue does this PR close?
TableMetadata
to new location. #1388What changes are included in this PR?
TableMetadataIO
to read/write metadata from/to a locationAre these changes tested?
Added unit test