From 11d404d36df24553cfc902b1b0e4484ea49511c1 Mon Sep 17 00:00:00 2001 From: eldenmoon <15605149486@163.com> Date: Thu, 10 Oct 2024 18:40:38 +0800 Subject: [PATCH] fix comment --- be/src/olap/tablet_reader.cpp | 1 + be/src/olap/tablet_schema.h | 5 +++-- be/src/vec/common/schema_util.cpp | 3 ++- .../src/main/java/org/apache/doris/catalog/Column.java | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/be/src/olap/tablet_reader.cpp b/be/src/olap/tablet_reader.cpp index 61a18d04ff52d8..82db776fc54228 100644 --- a/be/src/olap/tablet_reader.cpp +++ b/be/src/olap/tablet_reader.cpp @@ -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; } diff --git a/be/src/olap/tablet_schema.h b/be/src/olap/tablet_schema.h index c066ab6468478c..4fe2efc1917bee 100644 --- a/be/src/olap/tablet_schema.h +++ b/be/src/olap/tablet_schema.h @@ -178,12 +178,13 @@ class TabletColumn { const std::vector& 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 && diff --git a/be/src/vec/common/schema_util.cpp b/be/src/vec/common/schema_util.cpp index 69dcce366a9015..7f5227af7ef90f 100644 --- a/be/src/vec/common/schema_util.cpp +++ b/be/src/vec/common/schema_util.cpp @@ -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; } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Column.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/Column.java index 5714970483c5dc..79245eac79fa19 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Column.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Column.java @@ -667,6 +667,7 @@ private void setChildrenTColumn(Column children, TColumn tColumn) { private void addChildren(Column column, TColumn tColumn) { List childrenColumns = column.getChildren(); + tColumn.setChildrenColumn(new ArrayList<>()); for (Column c : childrenColumns) { setChildrenTColumn(c, tColumn); }