mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-28 06:36:18 +00:00
fix: access ColumnSchema fields directly and use plain format args
ColumnSchema exposes name and data_type as public fields, not methods, and the telemetry macros only accept a format string after the error. Signed-off-by: fengyue-xve <1759519137@qq.com>
This commit is contained in:
@@ -97,14 +97,11 @@ pub(crate) fn changed_column_types(
|
||||
) -> HashMap<String, ConcreteDataType> {
|
||||
let mut changed = HashMap::new();
|
||||
for new_column in new_schema.column_schemas() {
|
||||
let Some(old_column) = old_schema.column_schema_by_name(new_column.name()) else {
|
||||
let Some(old_column) = old_schema.column_schema_by_name(&new_column.name) else {
|
||||
continue;
|
||||
};
|
||||
if old_column.data_type() != new_column.data_type() {
|
||||
changed.insert(
|
||||
new_column.name().to_string(),
|
||||
new_column.data_type().clone(),
|
||||
);
|
||||
if old_column.data_type != new_column.data_type {
|
||||
changed.insert(new_column.name.clone(), new_column.data_type.clone());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,10 +212,11 @@ fn validate_comparison(
|
||||
if let Err(error) = scalar.cast_to(&target_arrow_type) {
|
||||
warn!(
|
||||
error;
|
||||
"Persisted partition bound is not representable with the altered column type";
|
||||
"region_id" => %region_id,
|
||||
"column" => column,
|
||||
"target_type" => target_type.to_string(),
|
||||
"Persisted partition bound is not representable with the altered column type, \
|
||||
region_id: {}, column: '{}', target_type: {}",
|
||||
region_id,
|
||||
column,
|
||||
target_type
|
||||
);
|
||||
return PartitionExprIncompatibleSnafu {
|
||||
region_id,
|
||||
|
||||
Reference in New Issue
Block a user