Skip to content

Rest: Implement register table #1521

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gabeiglio
Copy link

Which issue does this PR close?

What changes are included in this PR?

  • New type for RegisterTableRequest
  • New method in rest catalog for implementing register table

Are these changes tested?

  • 2 unit tests for a successful registered table operation and a failed one due to namespace is non existent
  • Integration tests for a successful registered table operation

Im new to Rust so any feedback is welcomed! :)

@gabeiglio gabeiglio force-pushed the rest-register-table branch from 0bfda56 to 5c342f3 Compare July 17, 2025 07:52
@gabeiglio gabeiglio marked this pull request as ready for review July 17, 2025 16:37
Copy link
Contributor

@CTTY CTTY left a comment

Choose a reason for hiding this comment

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

Hi @gabeiglio , thanks for your contribution! I've left some suggestions

let metadata_location = response.metadata_location.as_ref().ok_or(Error::new(
ErrorKind::DataInvalid,
"Metadata location missing in `register_table` response!",
))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this can be slightly simplified using some syntax sugar

let Some(metadata_location) = response.metadata_location else { return Err(Error::new(...)) }

let file_io = self.load_file_io(metadata_location, None).await?;

Copy link
Author

@gabeiglio gabeiglio Jul 28, 2025

Choose a reason for hiding this comment

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

I think for this we would need to change the signature of load_file_io since it is expecting a Option<&str>. Which I think it would make sense to change since all the metadata_location fields in the requests responses are String

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

Thanks @gabeiglio for this pr, generally LGTM! Left some comments to fix.

) -> Result<Table> {
// TODO: Use overwrite in `insert_new_table` to overwrite metadata for an already existing table
Copy link
Author

Choose a reason for hiding this comment

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

Thinking this could be a 'good first issue'?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking change, and I would not do it now. We can just pass overwrite=false to remote catalog. Currently java didn't support overwrite in api, and I don't think we need to do it now.

@gabeiglio gabeiglio force-pushed the rest-register-table branch from de387fc to 064c927 Compare July 28, 2025 17:44
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.

Implement register_table for rest catalog
3 participants