Skip to content

Commit

Permalink
fix style and refactor some error descriptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachelint committed Apr 23, 2023
1 parent c08ec5d commit cc0872a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion query_frontend/src/frontend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use std::{sync::Arc, time::Instant};


use ceresdbproto::{prometheus::Expr as PromExpr, storage::WriteTableRequest};
use cluster::config::SchemaConfig;
use common_types::request_id::RequestId;
Expand Down
10 changes: 6 additions & 4 deletions query_frontend/src/influxql/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ impl<'a, P: MetaProvider> SchemaProvider for InfluxQLSchemaProvider<'a, P> {
self.context_provider
.get_table_provider(table_ref.into())
.map_err(|e| {
DataFusionError::Plan(format!("measurement does not exist: {name}, source:{e}"))
DataFusionError::Plan(format!(
"measurement does not exist, measurement:{name}, source:{e}"
))
})
}

Expand All @@ -72,7 +74,7 @@ impl<'a, P: MetaProvider> SchemaProvider for InfluxQLSchemaProvider<'a, P> {
Err(e) => {
// Restricted by the external interface of iox, we can just print error log here
// and return empty `Vec`.
error!("Influxql planner occurred error while trying to get all tables, err:{e}");
error!("Influxql planner failed to get all tables, err:{e}");
return Vec::default();
}
};
Expand All @@ -86,7 +88,7 @@ impl<'a, P: MetaProvider> SchemaProvider for InfluxQLSchemaProvider<'a, P> {
Err(e) => {
// Restricted by the external interface of iox, we can just print error log here
// and return None.
error!("Influxql planner occurred error while trying to get table schema, name:{name}, err:{e}");
error!("Influxql planner failed to get table schema, name:{name}, err:{e}");
return None;
}
};
Expand All @@ -96,7 +98,7 @@ impl<'a, P: MetaProvider> SchemaProvider for InfluxQLSchemaProvider<'a, P> {
Ok(schema) => schema,
Err(e) => {
// Same as above here.
error!("Influxql planner occurred error while converting schema to influxql schema, schema:{ceresdb_arrow_schema}, err:{e}");
error!("Influxql planner failed to convert schema to influxql schema, schema:{ceresdb_arrow_schema}, err:{e}");
return None;
}
};
Expand Down
4 changes: 2 additions & 2 deletions query_frontend/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ impl<'a> MetaProvider for CatalogMetaProvider<'a> {
self.function_registry.find_udaf(name).context(FindUdf)
}

// TODO: when support not only default catalog and schema, we should refactor
// the tables collecting procedure.
// TODO: after supporting not only default catalog and schema, we should
// refactor the tables collecting procedure.
fn all_tables(&self) -> Result<Vec<TableRef>> {
let catalog = match self
.manager
Expand Down

0 comments on commit cc0872a

Please sign in to comment.