-
Notifications
You must be signed in to change notification settings - Fork 594
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
feat(nimtable): nimtable make drop table more robust #18422
Merged
chenzl25
merged 2 commits into
nimtable_dev
from
dylan/nimtable_make_drop_table_more_robust
Sep 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1312,24 +1312,22 @@ pub async fn handle_create_table( | |
.await?; | ||
} | ||
Engine::Iceberg => { | ||
// export AWS_REGION=your_region | ||
// export AWS_ACCESS_KEY_ID=your_access_key | ||
// export AWS_SECRET_ACCESS_KEY=your_secret_key | ||
// export RW_S3_ENDPOINT=your_endpoint | ||
// export META_STORE_URI=your_meta_store_uri | ||
// export META_STORE_USER=your_meta_store_user | ||
// export META_STORE_PASSWORD=your_meta_store_password | ||
|
||
let s3_endpoint = if let Ok(endpoint) = std::env::var("RW_S3_ENDPOINT") { | ||
let s3_region = if let Ok(region) = std::env::var("AWS_REGION") { | ||
region | ||
} else { | ||
"us-east-1".to_string() | ||
}; | ||
|
||
let s3_endpoint = if let Ok(endpoint) = std::env::var("AWS_ENDPOINT_URL") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
endpoint | ||
} else { | ||
"http://127.0.0.1:9301".to_string() | ||
}; | ||
|
||
let s3_region = if let Ok(region) = std::env::var("AWS_REGION") { | ||
region | ||
let s3_bucket = if let Ok(bucket) = std::env::var("AWS_BUCKET") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
bucket | ||
} else { | ||
"us-east-1".to_string() | ||
"hummock001".to_string() | ||
}; | ||
|
||
let s3_ak = if let Ok(ak) = std::env::var("AWS_ACCESS_KEY_ID") { | ||
|
@@ -1438,7 +1436,7 @@ pub async fn handle_create_table( | |
with.insert("primary_key".to_string(), pks.join(",")); | ||
with.insert("type".to_string(), "upsert".to_string()); | ||
with.insert("catalog.type".to_string(), "jdbc".to_string()); | ||
with.insert("warehouse.path".to_string(), "s3://hummock001".to_string()); | ||
with.insert("warehouse.path".to_string(), format!("s3://{}", s3_bucket)); | ||
with.insert("s3.endpoint".to_string(), s3_endpoint.clone()); | ||
with.insert("s3.access.key".to_string(), s3_ak.clone()); | ||
with.insert("s3.secret.key".to_string(), s3_sk.clone()); | ||
|
@@ -1452,6 +1450,7 @@ pub async fn handle_create_table( | |
with.insert("catalog.name".to_string(), catalog_name.clone()); | ||
with.insert("database.name".to_string(), database_name.clone()); | ||
with.insert("table.name".to_string(), table_name.to_string()); | ||
with.insert("commit_checkpoint_interval".to_string(), "1".to_string()); | ||
with.insert("create_table_if_not_exists".to_string(), "true".to_string()); | ||
sink_handler_args.with_options = WithOptions::new_with_options(with); | ||
|
||
|
@@ -1474,7 +1473,7 @@ pub async fn handle_create_table( | |
let mut with = BTreeMap::new(); | ||
with.insert("connector".to_string(), "iceberg".to_string()); | ||
with.insert("catalog.type".to_string(), "jdbc".to_string()); | ||
with.insert("warehouse.path".to_string(), "s3://hummock001".to_string()); | ||
with.insert("warehouse.path".to_string(), format!("s3://{}", s3_bucket)); | ||
with.insert("s3.endpoint".to_string(), s3_endpoint.clone()); | ||
with.insert("s3.access.key".to_string(), s3_ak.clone()); | ||
with.insert("s3.secret.key".to_string(), s3_sk.clone()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a required field without default value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Currently, the default value is used in local development. We can make all of them required.