Skip to content

Commit

Permalink
fix: update_table throws Unsupported, add catalog filter to drop_nsp
Browse files Browse the repository at this point in the history
Signed-off-by: callum-ryan <[email protected]>
  • Loading branch information
callum-ryan committed Sep 30, 2024
1 parent 5894475 commit 07a989e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions crates/catalog/sql/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ use iceberg::io::FileIO;
use iceberg::spec::{TableMetadata, TableMetadataBuilder};
use iceberg::table::Table;
use iceberg::{
Catalog, Error, Namespace, NamespaceIdent, Result, TableCommit, TableCreation, TableIdent,
Catalog, Error, ErrorKind, Namespace, NamespaceIdent, Result, TableCommit, TableCreation,
TableIdent,
};
use sqlx::any::{install_default_drivers, AnyPoolOptions, AnyQueryResult, AnyRow};
use sqlx::{Any, AnyPool, Row, Transaction};
Expand Down Expand Up @@ -496,8 +497,12 @@ impl Catalog for SqlCatalog {
}

self.execute(
&format!("DELETE FROM {NAMESPACE_TABLE_NAME} WHERE {NAMESPACE_FIELD_NAME} = ?"),
vec![Some(&namespace.join("."))],
&format!(
"DELETE FROM {NAMESPACE_TABLE_NAME}
WHERE {NAMESPACE_FIELD_NAME} = ?
AND {CATALOG_FIELD_CATALOG_NAME} = ?"
),
vec![Some(&namespace.join(".")), Some(&self.name)],
None,
)
.await?;
Expand Down Expand Up @@ -763,7 +768,10 @@ impl Catalog for SqlCatalog {
}

async fn update_table(&self, _commit: TableCommit) -> Result<Table> {
todo!()
Err(Error::new(
ErrorKind::FeatureUnsupported,
"Updating a table is not supported yet",
))
}
}

Expand Down

0 comments on commit 07a989e

Please sign in to comment.