CTTY commented on code in PR #1724:
URL: https://github.com/apache/iceberg-rust/pull/1724#discussion_r2418482468
##########
crates/catalog/sql/src/catalog.rs:
##########
@@ -216,6 +216,11 @@ impl SqlCatalog {
}
}
}
+
+ /// Get the catalogs `FileIO`
+ pub fn file_io(&self) -> FileIO {
+ self.fileio.clone()
+ }
Review Comment:
I think this is unnecessary, catalog ideally should not expose its file io
##########
crates/catalog/sql/src/catalog.rs:
##########
@@ -765,13 +770,30 @@ impl Catalog for SqlCatalog {
async fn register_table(
&self,
- _table_ident: &TableIdent,
- _metadata_location: String,
+ table_ident: &TableIdent,
+ metadata_location: String,
) -> Result<Table> {
- Err(Error::new(
- ErrorKind::FeatureUnsupported,
- "Registering a table is not supported yet",
- ))
+ if !self.table_exists(table_ident).await? {
Review Comment:
Is this correct? I think the correct behavior is
```
if table_exists {
// error out, there is an existing table sharing the same table identity
} else {
// continue to register the input metadata location
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]