Skip to content

Commit

Permalink
fix breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
liurenjie1024 committed Sep 19, 2023
1 parent 0e15117 commit 7d91a2f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/connector/src/sink/iceberg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ pub struct IcebergConfig {
#[serde(rename = "database.name")]
pub database_name: String, // Use as catalog name.

// Catalog type supported by iceberg, such as "storage", "rest".
// If not set, we use "storage" as default.
#[serde(rename = "catalog.type")]
pub catalog_type: String, // Catalog type supported by iceberg, such as "storage", "rest"
pub catalog_type: Option<String>,

#[serde(rename = "warehouse.path")]
pub path: Option<String>, // Path of iceberg warehouse, only applicable in storage catalog.
Expand Down Expand Up @@ -108,7 +110,13 @@ impl IcebergConfig {

fn build_iceberg_configs(&self) -> HashMap<String, String> {
let mut iceberg_configs = HashMap::new();
iceberg_configs.insert(CATALOG_TYPE.to_string(), self.catalog_type.clone());
iceberg_configs.insert(
CATALOG_TYPE.to_string(),
self.catalog_type
.as_deref()
.unwrap_or("storage")
.to_string(),
);
iceberg_configs.insert(
CATALOG_NAME.to_string(),
self.database_name.clone().to_string(),
Expand Down

0 comments on commit 7d91a2f

Please sign in to comment.