Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions crates/catalog/s3tables/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,9 @@ impl Catalog for S3TablesCatalog {
.await
.map_err(from_aws_sdk_error)?;

// prepare metadata location. the warehouse location is generated by s3tables catalog,
// prepare table location. the warehouse location is generated by s3tables catalog,
// which looks like: s3://e6c9bf20-991a-46fb-kni5xs1q2yxi3xxdyxzjzigdeop1quse2b--table-s3
let metadata_location = match &creation.location {
let table_location = match &creation.location {
Some(_) => {
return Err(Error::new(
ErrorKind::DataInvalid,
Expand All @@ -467,16 +467,17 @@ impl Catalog for S3TablesCatalog {
.send()
.await
.map_err(from_aws_sdk_error)?;
let warehouse_location = get_resp.warehouse_location().to_string();
MetadataLocation::new_with_table_location(warehouse_location).to_string()
get_resp.warehouse_location().to_string()
}
};

// write metadata to file
creation.location = Some(metadata_location.clone());
creation.location = Some(table_location.clone());
let metadata = TableMetadataBuilder::from_table_creation(creation)?
.build()?
.metadata;
let metadata_location =
MetadataLocation::new_with_table_location(table_location).to_string();
metadata.write_to(&self.file_io, &metadata_location).await?;

// update metadata location
Expand Down
Loading