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

eldenmoon 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 480987a0581 [refactor](jsonb) rename `JsonbValue::length` to 
`JsonbValue::numElements` (#51911)
480987a0581 is described below

commit 480987a0581671485973c9f499eb3fede630016f
Author: lihangyu <[email protected]>
AuthorDate: Thu Jun 19 15:38:05 2025 +0800

    [refactor](jsonb) rename `JsonbValue::length` to `JsonbValue::numElements` 
(#51911)
---
 be/src/util/jsonb_document.h                             | 4 ++--
 be/src/vec/exprs/table_function/vexplode_json_object.cpp | 2 +-
 be/src/vec/functions/function_jsonb.cpp                  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/be/src/util/jsonb_document.h b/be/src/util/jsonb_document.h
index f67fa79cbd3..116deb7ee2e 100644
--- a/be/src/util/jsonb_document.h
+++ b/be/src/util/jsonb_document.h
@@ -582,7 +582,7 @@ public:
     unsigned int size() const;
 
     //Get the number of jsonbvalue elements
-    int length() const;
+    int numElements() const;
 
     //Whether to include the jsonbvalue rhs
     bool contains(JsonbValue* rhs) const;
@@ -1272,7 +1272,7 @@ inline unsigned int JsonbValue::size() const {
     }
 }
 
-inline int JsonbValue::length() const {
+inline int JsonbValue::numElements() const {
     switch (type_) {
     case JsonbType::T_Int8:
     case JsonbType::T_Int16:
diff --git a/be/src/vec/exprs/table_function/vexplode_json_object.cpp 
b/be/src/vec/exprs/table_function/vexplode_json_object.cpp
index 8e823923438..b545ce602a8 100644
--- a/be/src/vec/exprs/table_function/vexplode_json_object.cpp
+++ b/be/src/vec/exprs/table_function/vexplode_json_object.cpp
@@ -64,7 +64,7 @@ void VExplodeJsonObjectTableFunction::process_row(size_t 
row_idx) {
         JsonbValue* value = doc->getValue();
         auto writer = std::make_unique<JsonbWriter>();
         if (value->isObject()) {
-            _cur_size = value->length();
+            _cur_size = value->numElements();
             auto* obj = (ObjectVal*)value;
             _object_pairs.first =
                     ColumnNullable::create(ColumnString::create(), 
ColumnUInt8::create());
diff --git a/be/src/vec/functions/function_jsonb.cpp 
b/be/src/vec/functions/function_jsonb.cpp
index 4ebb87d8739..4833e0bf8f8 100644
--- a/be/src/vec/functions/function_jsonb.cpp
+++ b/be/src/vec/functions/function_jsonb.cpp
@@ -1381,7 +1381,7 @@ struct JsonbLengthUtil {
                 res->insert_data(nullptr, 0);
                 continue;
             }
-            auto length = value->length();
+            auto length = value->numElements();
             res->insert_data(const_cast<const char*>((char*)&length), 0);
         }
         block.replace_by_position(result,


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

Reply via email to