Skip to content

Commit

Permalink
feat(nimtabe): change nimtable iceberg bucket and data directory (#18899
Browse files Browse the repository at this point in the history
)
  • Loading branch information
chenzl25 authored Oct 14, 2024
1 parent 1e11034 commit d9925b1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions risedev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ profile:
NIMTABLE_ENABLE_CONFIG_LOAD: "false"
AWS_ENDPOINT_URL: "http://127.0.0.1:9301"
AWS_REGION: "ap-southeast-2"
AWS_S3_BUCKET: "hummock001"
RW_DATA_DIRECTORY: "data-dir"
NIMTABLE_S3_BUCKET: "hummock001"
NIMTABLE_DATA_DIRECTORY: "data-dir"
AWS_ACCESS_KEY_ID: "hummockadmin"
AWS_SECRET_ACCESS_KEY: "hummockadmin"
RW_BACKEND: "postgres"
Expand Down
2 changes: 1 addition & 1 deletion src/common/src/session_config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct SessionConfig {
/// If `RW_IMPLICIT_FLUSH` is on, then every INSERT/UPDATE/DELETE statement will block
/// until the entire dataflow is refreshed. In other words, every related table & MV will
/// be able to see the write.
#[parameter(default = true, rename = "rw_implicit_flush")]
#[parameter(default = true, alias = "rw_implicit_flush")]
implicit_flush: bool,

/// If `CREATE_COMPACTION_GROUP_FOR_MV` is on, dedicated compaction groups will be created in
Expand Down
18 changes: 10 additions & 8 deletions src/connector/src/connector_common/iceberg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,14 @@ impl IcebergCommon {
s3_region.clone().to_string(),
);

let Ok(s3_bucket) = std::env::var("AWS_S3_BUCKET") else {
bail!("To create an iceberg engine table, AWS_S3_BUCKET needed to be set");
let Ok(s3_bucket) = std::env::var("NIMTABLE_S3_BUCKET") else {
bail!("To create an iceberg engine table, NIMTABLE_S3_BUCKET needed to be set");
};

let Ok(data_directory) = std::env::var("RW_DATA_DIRECTORY") else {
bail!("To create an iceberg engine table, RW_DATA_DIRECTORY needed to be set");
let Ok(data_directory) = std::env::var("NIMTABLE_DATA_DIRECTORY") else {
bail!(
"To create an iceberg engine table, NIMTABLE_DATA_DIRECTORY needed to be set"
);
};
let warehouse_path = format!("s3://{}/{}/nimtable", s3_bucket, data_directory);

Expand Down Expand Up @@ -830,13 +832,13 @@ mod v2 {
};
file_io_props.insert(S3_REGION.to_string(), s3_region);

let Ok(s3_bucket) = std::env::var("AWS_S3_BUCKET") else {
bail!("To create an iceberg engine table, AWS_S3_BUCKET needed to be set");
let Ok(s3_bucket) = std::env::var("NIMTABLE_S3_BUCKET") else {
bail!("To create an iceberg engine table, NIMTABLE_S3_BUCKET needed to be set");
};

let Ok(data_directory) = std::env::var("RW_DATA_DIRECTORY") else {
let Ok(data_directory) = std::env::var("NIMTABLE_DATA_DIRECTORY") else {
bail!(
"To create an iceberg engine table, RW_DATA_DIRECTORY needed to be set"
"To create an iceberg engine table, NIMTABLE_DATA_DIRECTORY needed to be set"
);
};

Expand Down
10 changes: 6 additions & 4 deletions src/frontend/src/handler/create_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1344,12 +1344,14 @@ pub async fn handle_create_table(
bail!("To create an iceberg engine table, AWS_REGION needed to be set");
};

let Ok(s3_bucket) = std::env::var("AWS_S3_BUCKET") else {
bail!("To create an iceberg engine table, AWS_BUCKET needed to be set");
let Ok(s3_bucket) = std::env::var("NIMTABLE_S3_BUCKET") else {
bail!("To create an iceberg engine table, NIMTABLE_S3_BUCKET needed to be set");
};

let Ok(data_directory) = std::env::var("RW_DATA_DIRECTORY") else {
bail!("To create an iceberg engine table, RW_DATA_DIRECTORY needed to be set");
let Ok(data_directory) = std::env::var("NIMTABLE_DATA_DIRECTORY") else {
bail!(
"To create an iceberg engine table, NIMTABLE_DATA_DIRECTORY needed to be set"
);
};

let s3_ak = if let Ok(s3_ak) = std::env::var("AWS_ACCESS_KEY_ID") {
Expand Down

0 comments on commit d9925b1

Please sign in to comment.