mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-23 06:30:05 +00:00
feat(TableRouteValue): add panic notes and type checks (#3031)
* refactor(TableRouteValue): add panic notes and type checks * chore: add deprecate develop branch warning Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * add error defines and checks * Update README.md * update code format and fix tests * update name of error * delete unused note * fix unsafe .expect() for region_route() * update error name * update unwrap * update code format --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com> Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -521,11 +521,15 @@ CREATE TABLE {table_name} (
|
||||
.unwrap()
|
||||
.into_inner();
|
||||
|
||||
let region_to_dn_map = region_distribution(table_route_value.region_routes())
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|(k, v)| (v[0], *k))
|
||||
.collect::<HashMap<u32, u64>>();
|
||||
let region_to_dn_map = region_distribution(
|
||||
table_route_value
|
||||
.region_routes()
|
||||
.expect("physical table route"),
|
||||
)
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|(k, v)| (v[0], *k))
|
||||
.collect::<HashMap<u32, u64>>();
|
||||
assert!(region_to_dn_map.len() <= instance.datanodes().len());
|
||||
|
||||
let stmt = QueryLanguageParser::parse_sql(&format!(
|
||||
|
||||
Reference in New Issue
Block a user