Skip to content

Commit 442528f

Browse files
committed
fix: make s3tables catalog public
1 parent c5cc9e4 commit 442528f

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

crates/catalog/s3tables/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ aws-config = { workspace = true }
3535
aws-sdk-s3tables = "1.6.0"
3636
iceberg = { workspace = true }
3737
serde_json = { workspace = true }
38+
typed-builder = { workspace = true }
3839
uuid = { workspace = true, features = ["v4"] }
3940

4041
[dev-dependencies]

crates/catalog/s3tables/src/catalog.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ use iceberg::{
3131
Catalog, Error, ErrorKind, Namespace, NamespaceIdent, Result, TableCommit, TableCreation,
3232
TableIdent,
3333
};
34+
use typed_builder::TypedBuilder;
3435

3536
use crate::utils::{create_metadata_location, create_sdk_config};
3637

3738
/// S3Tables catalog configuration.
38-
#[derive(Debug)]
39+
#[derive(Debug, TypedBuilder)]
3940
pub struct S3TablesCatalogConfig {
4041
/// Unlike other buckets, S3Tables bucket is not a physical bucket, but a virtual bucket
4142
/// that is managed by s3tables. We can't directly access the bucket with path like
@@ -48,8 +49,10 @@ pub struct S3TablesCatalogConfig {
4849
/// - `aws_access_key_id`: The AWS access key ID to use.
4950
/// - `aws_secret_access_key`: The AWS secret access key to use.
5051
/// - `aws_session_token`: The AWS session token to use.
52+
#[builder(default)]
5153
properties: HashMap<String, String>,
5254
/// Endpoint URL for the catalog.
55+
#[builder(default, setter(strip_option(fallback = endpoint_url_opt)))]
5356
endpoint_url: Option<String>,
5457
}
5558

@@ -515,12 +518,9 @@ mod tests {
515518
None => return Ok(None),
516519
};
517520

518-
let properties = HashMap::new();
519-
let config = S3TablesCatalogConfig {
520-
table_bucket_arn,
521-
properties,
522-
endpoint_url: None,
523-
};
521+
let config = S3TablesCatalogConfig::builder()
522+
.table_bucket_arn(table_bucket_arn)
523+
.build();
524524

525525
Ok(Some(S3TablesCatalog::new(config).await?))
526526
}

crates/catalog/s3tables/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@
2121

2222
mod catalog;
2323
mod utils;
24+
25+
pub use catalog::*;

0 commit comments

Comments
 (0)