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

add test case for upsert_table_option #2489

Merged
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
20 changes: 20 additions & 0 deletions common/meta/api/src/meta_api_test_suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,26 @@ impl MetaApiTestSuite {
assert_eq!(want, got.as_ref().clone(), "get old table");
}

tracing::info!("--- update table options with key1=val1");
{
let table = mt.get_table("db1", "tb2").await.unwrap();
let got = mt
.upsert_table_option(
table.table_id,
table.version,
"key1".into(),
"val1".into(),
)
.await;
if let Err(ref err) = got {
// TODO: remove this check after upsert_table_option is implemented for MetaEmbedded
assert_eq!(err.code(), ErrorCode::UnImplementCode());
} else {
let table = mt.get_table("db1", "tb2").await.unwrap();
assert_eq!(table.options().get("key1"), Some(&"val1".into()));
}
}

tracing::info!("--- drop table with if_exists = false");
{
let plan = DropTablePlan {
Expand Down
4 changes: 3 additions & 1 deletion common/meta/embedded/src/meta_api_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ impl MetaApi for MetaEmbedded {
_option_key: String,
_option_value: String,
) -> Result<UpsertTableOptionReply> {
todo!()
Err(ErrorCode::UnImplement(
"not implemented in MetaEmbedded yet",
))
}

fn name(&self) -> String {
Expand Down