Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
eldenmoon committed Oct 10, 2024
1 parent fe85e2a commit 82ae21b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions be/src/olap/tablet_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ TabletColumn TabletReader::materialize_column(const TabletColumn& orig) {
}
column_with_cast_type.set_type(filed_type);
column_with_cast_type.set_precision_frac(cast_type.precision, cast_type.scale);
column_with_cast_type.set_is_decimal(cast_type.precision > 0);
return column_with_cast_type;
}

Expand Down
5 changes: 3 additions & 2 deletions be/src/olap/tablet_schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,13 @@ class TabletColumn {
const std::vector<TabletColumnPtr>& sparse_columns() const;
size_t num_sparse_columns() const { return _num_sparse_columns; }

void set_precision_frac(int32_t precision, int32_t frac, bool is_decimal = true) {
void set_precision_frac(int32_t precision, int32_t frac) {
_precision = precision;
_frac = frac;
_is_decimal = is_decimal;
}

void set_is_decimal(bool is_decimal) { _is_decimal = is_decimal; }

Status check_valid() const {
if (type() != FieldType::OLAP_FIELD_TYPE_ARRAY &&
type() != FieldType::OLAP_FIELD_TYPE_STRUCT &&
Expand Down
3 changes: 2 additions & 1 deletion be/src/vec/common/schema_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,11 @@ void get_column_by_type(const vectorized::DataTypePtr& data_type, const std::str
}
if (WhichDataType(*data_type).is_decimal()) {
column.set_precision_frac(data_type->get_precision(), data_type->get_scale());
column.set_is_decimal(true);
return;
}
if (WhichDataType(*data_type).is_date_time_v2()) {
column.set_precision_frac(-1, data_type->get_scale(), false);
column.set_precision_frac(-1, data_type->get_scale());
return;
}
}
Expand Down

0 comments on commit 82ae21b

Please sign in to comment.