Xuanwo commented on code in PR #807: URL: https://github.com/apache/iceberg-rust/pull/807#discussion_r1896346166
########## crates/catalog/s3tables/src/catalog.rs: ########## @@ -0,0 +1,620 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::collections::HashMap; + +use anyhow::anyhow; +use async_trait::async_trait; +use aws_sdk_s3tables::operation::create_table::CreateTableOutput; +use aws_sdk_s3tables::operation::get_namespace::GetNamespaceOutput; +use aws_sdk_s3tables::operation::get_table::GetTableOutput; +use aws_sdk_s3tables::operation::list_tables::ListTablesOutput; +use aws_sdk_s3tables::types::OpenTableFormat; +use iceberg::io::FileIO; +use iceberg::spec::{TableMetadata, TableMetadataBuilder}; +use iceberg::table::Table; +use iceberg::{ + Catalog, Error, ErrorKind, Namespace, NamespaceIdent, Result, TableCommit, TableCreation, + TableIdent, +}; + +use crate::utils::{create_metadata_location, create_sdk_config}; + +#[derive(Debug)] +pub struct S3TablesCatalogConfig { Review Comment: Please add comments for all public structs. ########## crates/catalog/s3tables/src/catalog.rs: ########## @@ -0,0 +1,620 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::collections::HashMap; + +use anyhow::anyhow; +use async_trait::async_trait; +use aws_sdk_s3tables::operation::create_table::CreateTableOutput; +use aws_sdk_s3tables::operation::get_namespace::GetNamespaceOutput; +use aws_sdk_s3tables::operation::get_table::GetTableOutput; +use aws_sdk_s3tables::operation::list_tables::ListTablesOutput; +use aws_sdk_s3tables::types::OpenTableFormat; +use iceberg::io::FileIO; +use iceberg::spec::{TableMetadata, TableMetadataBuilder}; +use iceberg::table::Table; +use iceberg::{ + Catalog, Error, ErrorKind, Namespace, NamespaceIdent, Result, TableCommit, TableCreation, + TableIdent, +}; + +use crate::utils::{create_metadata_location, create_sdk_config}; + +#[derive(Debug)] +pub struct S3TablesCatalogConfig { + table_bucket_arn: String, + properties: HashMap<String, String>, + endpoint_url: Option<String>, +} + +/// S3Tables catalog implementation. +#[derive(Debug)] +pub struct S3TablesCatalog { + config: S3TablesCatalogConfig, + s3tables_client: aws_sdk_s3tables::Client, + file_io: FileIO, +} + +impl S3TablesCatalog { + pub async fn new(config: S3TablesCatalogConfig) -> Result<Self> { Review Comment: The same, please add comments for all public APIs. Better to have an example if it's simple. ########## crates/catalog/s3tables/src/catalog.rs: ########## @@ -0,0 +1,620 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::collections::HashMap; + +use anyhow::anyhow; +use async_trait::async_trait; +use aws_sdk_s3tables::operation::create_table::CreateTableOutput; +use aws_sdk_s3tables::operation::get_namespace::GetNamespaceOutput; +use aws_sdk_s3tables::operation::get_table::GetTableOutput; +use aws_sdk_s3tables::operation::list_tables::ListTablesOutput; +use aws_sdk_s3tables::types::OpenTableFormat; +use iceberg::io::FileIO; +use iceberg::spec::{TableMetadata, TableMetadataBuilder}; +use iceberg::table::Table; +use iceberg::{ + Catalog, Error, ErrorKind, Namespace, NamespaceIdent, Result, TableCommit, TableCreation, + TableIdent, +}; + +use crate::utils::{create_metadata_location, create_sdk_config}; + +#[derive(Debug)] +pub struct S3TablesCatalogConfig { + table_bucket_arn: String, Review Comment: Hi, it's a bit confused for me to have a hard require for `table_bucket_arn` for the first look. Would you like to add a comment here to explain that all operations need `table_bucket_arn` instead of `bucket`? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org