This is an automated email from the ASF dual-hosted git repository.

panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new f90e8fcb26 [Chore](storage) add debug info for 
TabletColumn::get_aggregate_function (#21408)
f90e8fcb26 is described below

commit f90e8fcb26fe097f49b04bab49f99863a24705b2
Author: Pxl <[email protected]>
AuthorDate: Mon Jul 3 10:02:44 2023 +0800

    [Chore](storage) add debug info for TabletColumn::get_aggregate_function 
(#21408)
---
 be/src/olap/memtable.cpp      | 4 ++++
 be/src/olap/tablet_schema.cpp | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/be/src/olap/memtable.cpp b/be/src/olap/memtable.cpp
index 6d8975e84c..ae0165b9fc 100644
--- a/be/src/olap/memtable.cpp
+++ b/be/src/olap/memtable.cpp
@@ -111,6 +111,10 @@ void MemTable::_init_agg_functions(const 
vectorized::Block* block) {
         } else {
             function =
                     
_tablet_schema->column(cid).get_aggregate_function(vectorized::AGG_LOAD_SUFFIX);
+            if (function == nullptr) {
+                LOG(WARNING) << "column get aggregate function failed, column="
+                             << _tablet_schema->column(cid).name();
+            }
         }
 
         DCHECK(function != nullptr);
diff --git a/be/src/olap/tablet_schema.cpp b/be/src/olap/tablet_schema.cpp
index 414036ab58..c02e876cd7 100644
--- a/be/src/olap/tablet_schema.cpp
+++ b/be/src/olap/tablet_schema.cpp
@@ -506,7 +506,7 @@ vectorized::AggregateFunctionPtr 
TabletColumn::get_aggregate_function(std::strin
     std::string origin_name = 
TabletColumn::get_string_by_aggregation_type(_aggregation);
     auto type = 
vectorized::DataTypeFactory::instance().create_data_type(*this);
 
-    std::string agg_name = 
TabletColumn::get_string_by_aggregation_type(_aggregation) + suffix;
+    std::string agg_name = origin_name + suffix;
     std::transform(agg_name.begin(), agg_name.end(), agg_name.begin(),
                    [](unsigned char c) { return std::tolower(c); });
 
@@ -515,6 +515,11 @@ vectorized::AggregateFunctionPtr 
TabletColumn::get_aggregate_function(std::strin
     if (function) {
         return function;
     }
+    if (type->get_type_as_primitive_type() != PrimitiveType::TYPE_AGG_STATE) {
+        LOG(WARNING) << "get column aggregate function failed, 
aggregation_name=" << origin_name
+                     << ", column_type=" << type->get_name();
+        return nullptr;
+    }
     return get_aggregate_function_union(type);
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to