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

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new b3f4e548368 [Performance](json reader) optimize filling default values 
(#25542) (#31937)
b3f4e548368 is described below

commit b3f4e5483681d358e5b9bba9ab8be4eb5c602d5e
Author: lihangyu <[email protected]>
AuthorDate: Thu Mar 7 19:01:14 2024 +0800

    [Performance](json reader) optimize filling default values (#25542) (#31937)
    
    Add a faster path for filling default values, since looking up value map is 
relatively slow
---
 be/src/vec/exec/format/json/new_json_reader.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/be/src/vec/exec/format/json/new_json_reader.cpp 
b/be/src/vec/exec/format/json/new_json_reader.cpp
index feed55037a5..b698eb4e2ce 100644
--- a/be/src/vec/exec/format/json/new_json_reader.cpp
+++ b/be/src/vec/exec/format/json/new_json_reader.cpp
@@ -1435,7 +1435,13 @@ Status 
NewJsonReader::_simdjson_set_column_value(simdjson::ondemand::object* val
         if (_seen_columns[i]) {
             continue;
         }
-        auto slot_desc = slot_descs[i];
+        auto* slot_desc = slot_descs[i];
+        // Quick path to insert default value, instead of using default values 
in the value map.
+        if (_col_default_value_map.empty() ||
+            _col_default_value_map.find(slot_desc->col_name()) == 
_col_default_value_map.end()) {
+            
block.get_by_position(i).column->assume_mutable()->insert_default();
+            continue;
+        }
         if (!slot_desc->is_materialized()) {
             continue;
         }


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

Reply via email to