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

eldenmoon pushed a commit to branch variant-sparse
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/variant-sparse by this push:
     new 2cccd71f889 [fix](type) override get_type_name (#49065)
2cccd71f889 is described below

commit 2cccd71f8892270b1f8c79b6b09e750400e051d4
Author: Sun Chenyang <suncheny...@selectdb.com>
AuthorDate: Fri Mar 14 13:19:28 2025 +0800

    [fix](type) override get_type_name (#49065)
    
    ### What problem does this PR solve?
    
    Issue Number: close #xxx
    
    Related PR: #xxx
    
    Problem Summary:
    
    ### Release note
    
    None
    
    ### Check List (For Author)
    
    - Test <!-- At least one of them must be included. -->
        - [ ] Regression test
        - [ ] Unit Test
        - [ ] Manual test (add detailed scripts or steps below)
        - [ ] No need to test or manual test. Explain why:
    - [ ] This is a refactor/code format and no logic has been changed.
            - [ ] Previous test can cover this change.
            - [ ] No code files have been changed.
            - [ ] Other reason <!-- Add your reason?  -->
    
    - Behavior changed:
        - [ ] No.
        - [ ] Yes. <!-- Explain the behavior change -->
    
    - Does this need documentation?
        - [ ] No.
    - [ ] Yes. <!-- Add document PR link here. eg:
    https://github.com/apache/doris-website/pull/1214 -->
    
    ### Check List (For Reviewer who merge this PR)
    
    - [ ] Confirm the release note
    - [ ] Confirm test cases
    - [ ] Confirm document
    - [ ] Add branch pick label <!-- Add branch pick label that this PR
    should merge into -->
---
 be/src/vec/data_types/data_type_object.cpp | 4 +++-
 be/src/vec/data_types/data_type_object.h   | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/be/src/vec/data_types/data_type_object.cpp 
b/be/src/vec/data_types/data_type_object.cpp
index 62e4dec64dd..da5da95b5a0 100644
--- a/be/src/vec/data_types/data_type_object.cpp
+++ b/be/src/vec/data_types/data_type_object.cpp
@@ -48,7 +48,9 @@ class IColumn;
 namespace doris::vectorized {
 #include "common/compile_check_begin.h"
 DataTypeObject::DataTypeObject(int32_t max_subcolumns_count)
-        : _max_subcolumns_count(max_subcolumns_count) {}
+        : _max_subcolumns_count(max_subcolumns_count) {
+    name = fmt::format("Variant(max subcolumns count = {})", 
max_subcolumns_count);
+}
 bool DataTypeObject::equals(const IDataType& rhs) const {
     auto rhs_type = typeid_cast<const DataTypeObject*>(&rhs);
     if (rhs_type && _max_subcolumns_count != 
rhs_type->variant_max_subcolumns_count()) {
diff --git a/be/src/vec/data_types/data_type_object.h 
b/be/src/vec/data_types/data_type_object.h
index 272f086fc83..ad27c57ec68 100644
--- a/be/src/vec/data_types/data_type_object.h
+++ b/be/src/vec/data_types/data_type_object.h
@@ -50,11 +50,12 @@ namespace doris::vectorized {
 class DataTypeObject : public IDataType {
 private:
     int32_t _max_subcolumns_count = 0;
+    std::string name = "Variant";
 
 public:
     DataTypeObject() {}
     DataTypeObject(int32_t max_subcolumns_count);
-    const char* get_family_name() const override { return "Variant"; }
+    const char* get_family_name() const override { return name.c_str(); }
     TypeIndex get_type_id() const override { return TypeIndex::VARIANT; }
     TypeDescriptor get_type_as_type_descriptor() const override {
         return TypeDescriptor(TYPE_VARIANT, _max_subcolumns_count);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to