Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement aws sdk credential provider #84

Merged
merged 4 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion datafusion_iceberg/examples/dataframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use datafusion::arrow::record_batch::RecordBatch;
use datafusion::dataframe::DataFrameWriteOptions;
use datafusion::prelude::SessionContext;
use datafusion_iceberg::catalog::catalog::IcebergCatalog;
use iceberg_rust::catalog::bucket::ObjectStoreBuilder;
use iceberg_rust::catalog::identifier::Identifier;
use iceberg_rust::catalog::Catalog;
use iceberg_rust::object_store::ObjectStoreBuilder;
use iceberg_rust::spec::schema::Schema;
use iceberg_rust::spec::types::{StructField, StructType};
use iceberg_rust::table::Table;
Expand Down
2 changes: 1 addition & 1 deletion datafusion_iceberg/examples/insert_csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use datafusion::{
execution::{context::SessionContext, SessionStateBuilder},
};
use datafusion_expr::ScalarUDF;
use iceberg_rust::catalog::bucket::ObjectStoreBuilder;
use iceberg_rust::object_store::ObjectStoreBuilder;
use iceberg_sql_catalog::SqlCatalogList;

use datafusion_iceberg::{
Expand Down
3 changes: 2 additions & 1 deletion datafusion_iceberg/examples/insert_table.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use datafusion::{arrow::array::Int64Array, prelude::SessionContext};
use datafusion_iceberg::DataFusionTable;
use iceberg_rust::{
catalog::{bucket::ObjectStoreBuilder, Catalog},
catalog::Catalog,
object_store::ObjectStoreBuilder,
spec::{
partition::{PartitionField, PartitionSpec, Transform},
schema::Schema,
Expand Down
2 changes: 1 addition & 1 deletion datafusion_iceberg/examples/refresh_materialized_view.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use datafusion::{arrow::array::Int64Array, prelude::SessionContext};
use datafusion_iceberg::catalog::catalog::IcebergCatalog;
use datafusion_iceberg::materialized_view::refresh_materialized_view;
use iceberg_rust::catalog::bucket::ObjectStoreBuilder;
use iceberg_rust::catalog::CatalogList;
use iceberg_rust::materialized_view::MaterializedView;
use iceberg_rust::object_store::ObjectStoreBuilder;
use iceberg_rust::spec::partition::PartitionSpec;
use iceberg_rust::spec::view_metadata::{Version, ViewRepresentation};
use iceberg_rust::spec::{
Expand Down
4 changes: 2 additions & 2 deletions datafusion_iceberg/src/catalog/mirror.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
use dashmap::DashMap;
use datafusion::{datasource::TableProvider, error::DataFusionError};
use futures::{executor::LocalPool, task::LocalSpawnExt};
use iceberg_rust::store::IcebergStore;
use iceberg_rust::object_store::store::IcebergStore;
use std::{collections::HashSet, sync::Arc};

use iceberg_rust::spec::{tabular::TabularMetadata, view_metadata::REF_PREFIX};
use iceberg_rust::{
catalog::{
bucket::Bucket,
create::{CreateMaterializedView, CreateView},
identifier::Identifier,
namespace::Namespace,
tabular::Tabular,
Catalog,
},
error::Error as IcebergError,
object_store::Bucket,
spec::table_metadata::new_metadata_location,
};

Expand Down
16 changes: 8 additions & 8 deletions datafusion_iceberg/src/materialized_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,6 @@ pub async fn refresh_materialized_view(
mod tests {

use datafusion::{arrow::array::Int64Array, prelude::SessionContext};
use iceberg_rust::{
catalog::bucket::ObjectStoreBuilder,
spec::{
partition::{PartitionField, Transform},
schema::Schema,
types::{PrimitiveType, StructField, StructType, Type},
},
};
use iceberg_rust::{
catalog::CatalogList,
materialized_view::MaterializedView,
Expand All @@ -234,6 +226,14 @@ mod tests {
},
table::Table,
};
use iceberg_rust::{
object_store::ObjectStoreBuilder,
spec::{
partition::{PartitionField, Transform},
schema::Schema,
types::{PrimitiveType, StructField, StructType, Type},
},
};
use iceberg_sql_catalog::SqlCatalogList;
use std::sync::Arc;

Expand Down
2 changes: 1 addition & 1 deletion datafusion_iceberg/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ mod tests {
execution::{context::SessionContext, SessionStateBuilder},
};
use datafusion_expr::ScalarUDF;
use iceberg_rust::catalog::bucket::ObjectStoreBuilder;
use iceberg_rust::object_store::ObjectStoreBuilder;
use iceberg_sql_catalog::SqlCatalogList;
use tokio::time::sleep;

Expand Down
17 changes: 9 additions & 8 deletions datafusion_iceberg/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,15 @@ impl DataSink for IcebergDataSink {
mod tests {

use datafusion::{arrow::array::Int64Array, prelude::SessionContext};
use iceberg_rust::{
catalog::tabular::Tabular,
object_store::ObjectStoreBuilder,
spec::{
partition::{PartitionField, Transform},
schema::Schema,
types::{PrimitiveType, StructField, StructType, Type},
},
};
use iceberg_rust::{
catalog::Catalog,
spec::{
Expand All @@ -599,14 +608,6 @@ mod tests {
table::Table,
view::View,
};
use iceberg_rust::{
catalog::{bucket::ObjectStoreBuilder, tabular::Tabular},
spec::{
partition::{PartitionField, Transform},
schema::Schema,
types::{PrimitiveType, StructField, StructType, Type},
},
};
use iceberg_sql_catalog::SqlCatalog;

use std::{ops::Deref, sync::Arc};
Expand Down
4 changes: 2 additions & 2 deletions datafusion_iceberg/tests/integration_trino.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ use datafusion::execution::context::SessionContext;
use datafusion_iceberg::catalog::catalog::IcebergCatalog;
use iceberg_rest_catalog::apis::configuration::Configuration;
use iceberg_rest_catalog::catalog::RestCatalog;
use iceberg_rust::catalog::bucket::ObjectStoreBuilder;
use iceberg_rust::catalog::namespace::Namespace;
use iceberg_rust::catalog::Catalog;
use iceberg_rust::object_store::ObjectStoreBuilder;
use iceberg_rust::spec::partition::{PartitionField, PartitionSpec, Transform};
use iceberg_rust::spec::schema::Schema;
use iceberg_rust::spec::types::{PrimitiveType, StructField, StructType, Type};
Expand Down Expand Up @@ -183,7 +183,7 @@ async fn integration_trino_rest() {
.await
.unwrap();

let object_store = ObjectStoreBuilder::aws()
let object_store = ObjectStoreBuilder::s3()
.with_config("aws_access_key_id".parse().unwrap(), "user")
.with_config("aws_secret_access_key".parse().unwrap(), "password")
.with_config(
Expand Down
9 changes: 6 additions & 3 deletions iceberg-file-catalog/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use async_trait::async_trait;
use futures::{future, TryStreamExt};
use iceberg_rust::{
catalog::{
bucket::{Bucket, ObjectStoreBuilder},
commit::{
apply_table_updates, apply_view_updates, check_table_requirements,
check_view_requirements, CommitTable, CommitView, TableRequirement,
Expand All @@ -21,14 +20,15 @@ use iceberg_rust::{
},
error::Error as IcebergError,
materialized_view::MaterializedView,
object_store::store::IcebergStore,
object_store::{Bucket, ObjectStoreBuilder},
spec::{
materialized_view_metadata::MaterializedViewMetadata,
table_metadata::{new_metadata_location, TableMetadata},
tabular::TabularMetadata,
util::strip_prefix,
view_metadata::ViewMetadata,
},
store::IcebergStore,
table::Table,
view::View,
};
Expand Down Expand Up @@ -628,7 +628,10 @@ pub mod tests {
catalog::catalog::IcebergCatalog,
planner::{iceberg_transform, IcebergQueryPlanner},
};
use iceberg_rust::catalog::{bucket::ObjectStoreBuilder, namespace::Namespace, Catalog};
use iceberg_rust::{
catalog::{namespace::Namespace, Catalog},
object_store::ObjectStoreBuilder,
};
use std::sync::Arc;
// use testcontainers::{core::ExecCommand, runners::AsyncRunner, ImageExt};
// use testcontainers_modules::localstack::LocalStack;
Expand Down
9 changes: 6 additions & 3 deletions iceberg-glue-catalog/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use aws_sdk_glue::{
};
use iceberg_rust::{
catalog::{
bucket::{Bucket, ObjectStoreBuilder},
commit::{
apply_table_updates, apply_view_updates, check_table_requirements,
check_view_requirements, CommitTable, CommitView, TableRequirement,
Expand All @@ -24,6 +23,8 @@ use iceberg_rust::{
},
error::Error as IcebergError,
materialized_view::MaterializedView,
object_store::store::IcebergStore,
object_store::{Bucket, ObjectStoreBuilder},
spec::{
self,
materialized_view_metadata::MaterializedViewMetadata,
Expand All @@ -32,7 +33,6 @@ use iceberg_rust::{
util::strip_prefix,
view_metadata::ViewMetadata,
},
store::IcebergStore,
table::Table,
view::View,
};
Expand Down Expand Up @@ -910,7 +910,10 @@ pub mod tests {
catalog::catalog::IcebergCatalog,
planner::{iceberg_transform, IcebergQueryPlanner},
};
use iceberg_rust::catalog::{bucket::ObjectStoreBuilder, namespace::Namespace, Catalog};
use iceberg_rust::{
catalog::{namespace::Namespace, Catalog},
object_store::ObjectStoreBuilder,
};

use std::sync::Arc;
use testcontainers::{
Expand Down
7 changes: 3 additions & 4 deletions iceberg-rest-catalog/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Iceberg rest catalog implementation
*/
use iceberg_rust::{
catalog::{
bucket::{Bucket, ObjectStoreBuilder},
commit::CommitView,
create::{CreateMaterializedView, CreateTable, CreateView},
identifier::{self, Identifier},
Expand All @@ -15,6 +14,7 @@ use iceberg_rust::{
},
error::Error,
materialized_view::MaterializedView,
object_store::{Bucket, ObjectStoreBuilder},
spec::{
materialized_view_metadata::MaterializedViewMetadata,
table_metadata::TableMetadata,
Expand Down Expand Up @@ -516,9 +516,8 @@ impl CatalogList for RestCatalogList {
#[cfg(test)]
pub mod tests {
use iceberg_rust::{
catalog::{
bucket::ObjectStoreBuilder, identifier::Identifier, namespace::Namespace, Catalog,
},
catalog::{identifier::Identifier, namespace::Namespace, Catalog},
object_store::ObjectStoreBuilder,
spec::{
schema::Schema,
types::{PrimitiveType, StructField, StructType, Type},
Expand Down
2 changes: 1 addition & 1 deletion iceberg-rust/src/arrow/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use parquet::{
};
use uuid::Uuid;

use crate::{catalog::bucket::Bucket, error::Error, file_format::parquet::parquet_to_datafile};
use crate::{error::Error, file_format::parquet::parquet_to_datafile, object_store::Bucket};

use super::partition::partition_record_batches;

Expand Down
3 changes: 1 addition & 2 deletions iceberg-rust/src/catalog/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ use crate::materialized_view::MaterializedView;
use crate::table::Table;
use crate::view::View;

use self::bucket::Bucket;
use self::commit::{CommitTable, CommitView};
use self::create::{CreateMaterializedView, CreateTable, CreateView};
use self::namespace::Namespace;
use self::tabular::Tabular;
use crate::object_store::Bucket;

pub mod bucket;
pub mod commit;
pub mod create;
pub mod tabular;
Expand Down
2 changes: 1 addition & 1 deletion iceberg-rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ pub mod catalog;
pub mod error;
pub mod file_format;
pub mod materialized_view;
pub mod object_store;
pub mod spec;
pub mod sql;
pub mod store;
pub mod table;
pub(crate) mod util;
pub mod view;
4 changes: 2 additions & 2 deletions iceberg-rust/src/materialized_view/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use object_store::ObjectStore;

use crate::{
catalog::{
bucket::Bucket, create::CreateMaterializedViewBuilder, identifier::Identifier,
tabular::Tabular, Catalog,
create::CreateMaterializedViewBuilder, identifier::Identifier, tabular::Tabular, Catalog,
},
error::Error,
object_store::Bucket,
};

use self::{storage_table::StorageTable, transaction::Transaction as MaterializedViewTransaction};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use object_store::{

use crate::error::Error;

pub mod store;

/// Type for buckets for different cloud providers
#[derive(Debug)]
pub enum Bucket<'s> {
Expand Down Expand Up @@ -94,7 +96,7 @@ impl FromStr for ConfigKey {
}
impl ObjectStoreBuilder {
/// Create new AWS S3 Object Store builder
pub fn aws() -> Self {
pub fn s3() -> Self {
ObjectStoreBuilder::S3(AmazonS3Builder::from_env())
}
/// Create new AWS S3 Object Store builder
Expand Down
File renamed without changes.
Loading
Loading