be/src/exprs/table_function/vjson_each.cpp
Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | |
18 | | #include "exprs/table_function/vjson_each.h" |
19 | | |
20 | | #include <glog/logging.h> |
21 | | |
22 | | #include <ostream> |
23 | | #include <string> |
24 | | |
25 | | #include "common/status.h" |
26 | | #include "core/assert_cast.h" |
27 | | #include "core/block/block.h" |
28 | | #include "core/block/column_with_type_and_name.h" |
29 | | #include "core/column/column.h" |
30 | | #include "core/column/column_const.h" |
31 | | #include "core/column/column_struct.h" |
32 | | #include "core/string_ref.h" |
33 | | #include "exprs/vexpr.h" |
34 | | #include "exprs/vexpr_context.h" |
35 | | #include "util/jsonb_document.h" |
36 | | #include "util/jsonb_utils.h" |
37 | | #include "util/jsonb_writer.h" |
38 | | |
39 | | namespace doris { |
40 | | |
41 | | template <bool TEXT_MODE> |
42 | 223 | VJsonEachTableFunction<TEXT_MODE>::VJsonEachTableFunction() { |
43 | 223 | _fn_name = TEXT_MODE ? "vjson_each_text" : "vjson_each"; |
44 | 223 | } _ZN5doris22VJsonEachTableFunctionILb0EEC2Ev Line | Count | Source | 42 | 135 | VJsonEachTableFunction<TEXT_MODE>::VJsonEachTableFunction() { | 43 | 135 | _fn_name = TEXT_MODE ? "vjson_each_text" : "vjson_each"; | 44 | 135 | } |
_ZN5doris22VJsonEachTableFunctionILb1EEC2Ev Line | Count | Source | 42 | 88 | VJsonEachTableFunction<TEXT_MODE>::VJsonEachTableFunction() { | 43 | 88 | _fn_name = TEXT_MODE ? "vjson_each_text" : "vjson_each"; | 44 | 88 | } |
|
45 | | |
46 | | template <bool TEXT_MODE> |
47 | 85 | Status VJsonEachTableFunction<TEXT_MODE>::process_init(Block* block, RuntimeState* /*state*/) { |
48 | 85 | ColumnPtr value_column; |
49 | 85 | RETURN_IF_ERROR(_expr_context->root()->children()[0]->execute_column( |
50 | 85 | _expr_context.get(), block, nullptr, block->rows(), value_column)); |
51 | 85 | auto [col, is_const] = unpack_if_const(value_column); |
52 | 85 | _json_column = col; |
53 | 85 | _is_const = is_const; |
54 | 85 | return Status::OK(); |
55 | 85 | } _ZN5doris22VJsonEachTableFunctionILb0EE12process_initEPNS_5BlockEPNS_12RuntimeStateE Line | Count | Source | 47 | 53 | Status VJsonEachTableFunction<TEXT_MODE>::process_init(Block* block, RuntimeState* /*state*/) { | 48 | 53 | ColumnPtr value_column; | 49 | 53 | RETURN_IF_ERROR(_expr_context->root()->children()[0]->execute_column( | 50 | 53 | _expr_context.get(), block, nullptr, block->rows(), value_column)); | 51 | 53 | auto [col, is_const] = unpack_if_const(value_column); | 52 | 53 | _json_column = col; | 53 | 53 | _is_const = is_const; | 54 | 53 | return Status::OK(); | 55 | 53 | } |
_ZN5doris22VJsonEachTableFunctionILb1EE12process_initEPNS_5BlockEPNS_12RuntimeStateE Line | Count | Source | 47 | 32 | Status VJsonEachTableFunction<TEXT_MODE>::process_init(Block* block, RuntimeState* /*state*/) { | 48 | 32 | ColumnPtr value_column; | 49 | 32 | RETURN_IF_ERROR(_expr_context->root()->children()[0]->execute_column( | 50 | 32 | _expr_context.get(), block, nullptr, block->rows(), value_column)); | 51 | 32 | auto [col, is_const] = unpack_if_const(value_column); | 52 | 32 | _json_column = col; | 53 | 32 | _is_const = is_const; | 54 | 32 | return Status::OK(); | 55 | 32 | } |
|
56 | | |
57 | | // Helper: insert one JsonbValue as plain text into a ColumnNullable<ColumnString>. |
58 | | // For strings: raw blob content (quotes stripped, matching json_each_text PG semantics). |
59 | | // For null JSON values: SQL NULL (insert_default). |
60 | | // For all others (numbers, bools, objects, arrays): JSON text representation. |
61 | 42 | static void insert_value_as_text(const JsonbValue* value, MutableColumnPtr& col) { |
62 | 42 | if (value == nullptr || value->isNull()) { |
63 | 4 | col->insert_default(); |
64 | 4 | return; |
65 | 4 | } |
66 | 38 | if (value->isString()) { |
67 | 22 | const auto* str_val = value->unpack<JsonbStringVal>(); |
68 | 22 | col->insert_data(str_val->getBlob(), str_val->getBlobLen()); |
69 | 22 | } else { |
70 | 16 | JsonbToJson converter; |
71 | 16 | std::string text = converter.to_json_string(value); |
72 | 16 | col->insert_data(text.data(), text.size()); |
73 | 16 | } |
74 | 38 | } |
75 | | |
76 | | // Helper: insert one JsonbValue in JSONB binary form into a ColumnNullable<ColumnString>. |
77 | | // For null JSON values: SQL NULL (insert_default). |
78 | | // For all others: write JSONB binary via JsonbWriter. |
79 | | static void insert_value_as_json(const JsonbValue* value, MutableColumnPtr& col, |
80 | 81 | JsonbWriter& writer) { |
81 | 81 | if (value == nullptr || value->isNull()) { |
82 | 5 | col->insert_default(); |
83 | 5 | return; |
84 | 5 | } |
85 | 76 | writer.reset(); |
86 | 76 | writer.writeValue(value); |
87 | 76 | const auto* buf = writer.getOutput()->getBuffer(); |
88 | 76 | size_t len = writer.getOutput()->getSize(); |
89 | 76 | col->insert_data(buf, len); |
90 | 76 | } |
91 | | |
92 | | template <bool TEXT_MODE> |
93 | 109 | void VJsonEachTableFunction<TEXT_MODE>::process_row(size_t row_idx) { |
94 | 109 | TableFunction::process_row(row_idx); |
95 | 109 | if (_is_const && _cur_size > 0) { |
96 | 8 | return; |
97 | 8 | } |
98 | | |
99 | 101 | StringRef text; |
100 | 101 | const size_t idx = _is_const ? 0 : row_idx; |
101 | 101 | if (const auto* nullable_col = check_and_get_column<ColumnNullable>(*_json_column)) { |
102 | 101 | if (nullable_col->is_null_at(idx)) { |
103 | 13 | return; |
104 | 13 | } |
105 | 88 | text = assert_cast<const ColumnString&>(nullable_col->get_nested_column()).get_data_at(idx); |
106 | 88 | } else { |
107 | 0 | text = assert_cast<const ColumnString&>(*_json_column).get_data_at(idx); |
108 | 0 | } |
109 | | |
110 | 88 | const JsonbDocument* doc = nullptr; |
111 | 88 | auto st = JsonbDocument::checkAndCreateDocument(text.data, text.size, &doc); |
112 | 88 | if (!st.ok() || !doc || !doc->getValue()) [[unlikely]] { |
113 | 3 | return; |
114 | 3 | } |
115 | | |
116 | 85 | const JsonbValue* jv = doc->getValue(); |
117 | 85 | if (!jv->isObject()) { |
118 | 12 | return; |
119 | 12 | } |
120 | | |
121 | 73 | const auto* obj = jv->unpack<ObjectVal>(); |
122 | 73 | _cur_size = obj->numElem(); |
123 | 73 | if (_cur_size == 0) { |
124 | 15 | return; |
125 | 15 | } |
126 | | |
127 | 58 | _kv_pairs.first = ColumnNullable::create(ColumnString::create(), ColumnUInt8::create()); |
128 | 58 | _kv_pairs.second = ColumnNullable::create(ColumnString::create(), ColumnUInt8::create()); |
129 | 58 | _kv_pairs.first->reserve(_cur_size); |
130 | 58 | _kv_pairs.second->reserve(_cur_size); |
131 | | |
132 | 58 | if constexpr (TEXT_MODE) { |
133 | 42 | for (const auto& kv : *obj) { |
134 | 42 | _kv_pairs.first->insert_data(kv.getKeyStr(), kv.klen()); |
135 | 42 | insert_value_as_text(kv.value(), _kv_pairs.second); |
136 | 42 | } |
137 | 38 | } else { |
138 | 38 | JsonbWriter writer; |
139 | 81 | for (const auto& kv : *obj) { |
140 | 81 | _kv_pairs.first->insert_data(kv.getKeyStr(), kv.klen()); |
141 | 81 | insert_value_as_json(kv.value(), _kv_pairs.second, writer); |
142 | 81 | } |
143 | 38 | } |
144 | 58 | } _ZN5doris22VJsonEachTableFunctionILb0EE11process_rowEm Line | Count | Source | 93 | 68 | void VJsonEachTableFunction<TEXT_MODE>::process_row(size_t row_idx) { | 94 | 68 | TableFunction::process_row(row_idx); | 95 | 68 | if (_is_const && _cur_size > 0) { | 96 | 6 | return; | 97 | 6 | } | 98 | | | 99 | 62 | StringRef text; | 100 | 62 | const size_t idx = _is_const ? 0 : row_idx; | 101 | 62 | if (const auto* nullable_col = check_and_get_column<ColumnNullable>(*_json_column)) { | 102 | 62 | if (nullable_col->is_null_at(idx)) { | 103 | 7 | return; | 104 | 7 | } | 105 | 55 | text = assert_cast<const ColumnString&>(nullable_col->get_nested_column()).get_data_at(idx); | 106 | 55 | } else { | 107 | 0 | text = assert_cast<const ColumnString&>(*_json_column).get_data_at(idx); | 108 | 0 | } | 109 | | | 110 | 55 | const JsonbDocument* doc = nullptr; | 111 | 55 | auto st = JsonbDocument::checkAndCreateDocument(text.data, text.size, &doc); | 112 | 55 | if (!st.ok() || !doc || !doc->getValue()) [[unlikely]] { | 113 | 1 | return; | 114 | 1 | } | 115 | | | 116 | 54 | const JsonbValue* jv = doc->getValue(); | 117 | 54 | if (!jv->isObject()) { | 118 | 7 | return; | 119 | 7 | } | 120 | | | 121 | 47 | const auto* obj = jv->unpack<ObjectVal>(); | 122 | 47 | _cur_size = obj->numElem(); | 123 | 47 | if (_cur_size == 0) { | 124 | 9 | return; | 125 | 9 | } | 126 | | | 127 | 38 | _kv_pairs.first = ColumnNullable::create(ColumnString::create(), ColumnUInt8::create()); | 128 | 38 | _kv_pairs.second = ColumnNullable::create(ColumnString::create(), ColumnUInt8::create()); | 129 | 38 | _kv_pairs.first->reserve(_cur_size); | 130 | 38 | _kv_pairs.second->reserve(_cur_size); | 131 | | | 132 | | if constexpr (TEXT_MODE) { | 133 | | for (const auto& kv : *obj) { | 134 | | _kv_pairs.first->insert_data(kv.getKeyStr(), kv.klen()); | 135 | | insert_value_as_text(kv.value(), _kv_pairs.second); | 136 | | } | 137 | 38 | } else { | 138 | 38 | JsonbWriter writer; | 139 | 81 | for (const auto& kv : *obj) { | 140 | 81 | _kv_pairs.first->insert_data(kv.getKeyStr(), kv.klen()); | 141 | 81 | insert_value_as_json(kv.value(), _kv_pairs.second, writer); | 142 | 81 | } | 143 | 38 | } | 144 | 38 | } |
_ZN5doris22VJsonEachTableFunctionILb1EE11process_rowEm Line | Count | Source | 93 | 41 | void VJsonEachTableFunction<TEXT_MODE>::process_row(size_t row_idx) { | 94 | 41 | TableFunction::process_row(row_idx); | 95 | 41 | if (_is_const && _cur_size > 0) { | 96 | 2 | return; | 97 | 2 | } | 98 | | | 99 | 39 | StringRef text; | 100 | 39 | const size_t idx = _is_const ? 0 : row_idx; | 101 | 39 | if (const auto* nullable_col = check_and_get_column<ColumnNullable>(*_json_column)) { | 102 | 39 | if (nullable_col->is_null_at(idx)) { | 103 | 6 | return; | 104 | 6 | } | 105 | 33 | text = assert_cast<const ColumnString&>(nullable_col->get_nested_column()).get_data_at(idx); | 106 | 33 | } else { | 107 | 0 | text = assert_cast<const ColumnString&>(*_json_column).get_data_at(idx); | 108 | 0 | } | 109 | | | 110 | 33 | const JsonbDocument* doc = nullptr; | 111 | 33 | auto st = JsonbDocument::checkAndCreateDocument(text.data, text.size, &doc); | 112 | 33 | if (!st.ok() || !doc || !doc->getValue()) [[unlikely]] { | 113 | 2 | return; | 114 | 2 | } | 115 | | | 116 | 31 | const JsonbValue* jv = doc->getValue(); | 117 | 31 | if (!jv->isObject()) { | 118 | 5 | return; | 119 | 5 | } | 120 | | | 121 | 26 | const auto* obj = jv->unpack<ObjectVal>(); | 122 | 26 | _cur_size = obj->numElem(); | 123 | 26 | if (_cur_size == 0) { | 124 | 6 | return; | 125 | 6 | } | 126 | | | 127 | 20 | _kv_pairs.first = ColumnNullable::create(ColumnString::create(), ColumnUInt8::create()); | 128 | 20 | _kv_pairs.second = ColumnNullable::create(ColumnString::create(), ColumnUInt8::create()); | 129 | 20 | _kv_pairs.first->reserve(_cur_size); | 130 | 20 | _kv_pairs.second->reserve(_cur_size); | 131 | | | 132 | 20 | if constexpr (TEXT_MODE) { | 133 | 42 | for (const auto& kv : *obj) { | 134 | 42 | _kv_pairs.first->insert_data(kv.getKeyStr(), kv.klen()); | 135 | 42 | insert_value_as_text(kv.value(), _kv_pairs.second); | 136 | 42 | } | 137 | | } else { | 138 | | JsonbWriter writer; | 139 | | for (const auto& kv : *obj) { | 140 | | _kv_pairs.first->insert_data(kv.getKeyStr(), kv.klen()); | 141 | | insert_value_as_json(kv.value(), _kv_pairs.second, writer); | 142 | | } | 143 | | } | 144 | 20 | } |
|
145 | | |
146 | | template <bool TEXT_MODE> |
147 | 85 | void VJsonEachTableFunction<TEXT_MODE>::process_close() { |
148 | 85 | _json_column = nullptr; |
149 | 85 | _kv_pairs.first = nullptr; |
150 | 85 | _kv_pairs.second = nullptr; |
151 | 85 | _cur_size = 0; |
152 | 85 | } _ZN5doris22VJsonEachTableFunctionILb0EE13process_closeEv Line | Count | Source | 147 | 53 | void VJsonEachTableFunction<TEXT_MODE>::process_close() { | 148 | 53 | _json_column = nullptr; | 149 | 53 | _kv_pairs.first = nullptr; | 150 | 53 | _kv_pairs.second = nullptr; | 151 | 53 | _cur_size = 0; | 152 | 53 | } |
_ZN5doris22VJsonEachTableFunctionILb1EE13process_closeEv Line | Count | Source | 147 | 32 | void VJsonEachTableFunction<TEXT_MODE>::process_close() { | 148 | 32 | _json_column = nullptr; | 149 | 32 | _kv_pairs.first = nullptr; | 150 | 32 | _kv_pairs.second = nullptr; | 151 | 32 | _cur_size = 0; | 152 | 32 | } |
|
153 | | |
154 | | template <bool TEXT_MODE> |
155 | 5 | void VJsonEachTableFunction<TEXT_MODE>::get_same_many_values(MutableColumnPtr& column, int length) { |
156 | 5 | if (current_empty()) { |
157 | 1 | column->insert_many_defaults(length); |
158 | 1 | return; |
159 | 1 | } |
160 | | |
161 | 4 | ColumnStruct* ret; |
162 | 4 | if (_is_nullable) { |
163 | 3 | auto* nullable = assert_cast<ColumnNullable*>(column.get()); |
164 | 3 | ret = assert_cast<ColumnStruct*>(nullable->get_nested_column_ptr().get()); |
165 | 3 | assert_cast<ColumnUInt8*>(nullable->get_null_map_column_ptr().get()) |
166 | 3 | ->insert_many_defaults(length); |
167 | 3 | } else { |
168 | 1 | ret = assert_cast<ColumnStruct*>(column.get()); |
169 | 1 | } |
170 | | |
171 | 4 | ret->get_column(0).insert_many_from(*_kv_pairs.first, _cur_offset, length); |
172 | 4 | ret->get_column(1).insert_many_from(*_kv_pairs.second, _cur_offset, length); |
173 | 4 | } _ZN5doris22VJsonEachTableFunctionILb0EE20get_same_many_valuesERNS_3COWINS_7IColumnEE11mutable_ptrIS3_EEi Line | Count | Source | 155 | 4 | void VJsonEachTableFunction<TEXT_MODE>::get_same_many_values(MutableColumnPtr& column, int length) { | 156 | 4 | if (current_empty()) { | 157 | 1 | column->insert_many_defaults(length); | 158 | 1 | return; | 159 | 1 | } | 160 | | | 161 | 3 | ColumnStruct* ret; | 162 | 3 | if (_is_nullable) { | 163 | 2 | auto* nullable = assert_cast<ColumnNullable*>(column.get()); | 164 | 2 | ret = assert_cast<ColumnStruct*>(nullable->get_nested_column_ptr().get()); | 165 | 2 | assert_cast<ColumnUInt8*>(nullable->get_null_map_column_ptr().get()) | 166 | 2 | ->insert_many_defaults(length); | 167 | 2 | } else { | 168 | 1 | ret = assert_cast<ColumnStruct*>(column.get()); | 169 | 1 | } | 170 | | | 171 | 3 | ret->get_column(0).insert_many_from(*_kv_pairs.first, _cur_offset, length); | 172 | 3 | ret->get_column(1).insert_many_from(*_kv_pairs.second, _cur_offset, length); | 173 | 3 | } |
_ZN5doris22VJsonEachTableFunctionILb1EE20get_same_many_valuesERNS_3COWINS_7IColumnEE11mutable_ptrIS3_EEi Line | Count | Source | 155 | 1 | void VJsonEachTableFunction<TEXT_MODE>::get_same_many_values(MutableColumnPtr& column, int length) { | 156 | 1 | if (current_empty()) { | 157 | 0 | column->insert_many_defaults(length); | 158 | 0 | return; | 159 | 0 | } | 160 | | | 161 | 1 | ColumnStruct* ret; | 162 | 1 | if (_is_nullable) { | 163 | 1 | auto* nullable = assert_cast<ColumnNullable*>(column.get()); | 164 | 1 | ret = assert_cast<ColumnStruct*>(nullable->get_nested_column_ptr().get()); | 165 | 1 | assert_cast<ColumnUInt8*>(nullable->get_null_map_column_ptr().get()) | 166 | 1 | ->insert_many_defaults(length); | 167 | 1 | } else { | 168 | 0 | ret = assert_cast<ColumnStruct*>(column.get()); | 169 | 0 | } | 170 | | | 171 | 1 | ret->get_column(0).insert_many_from(*_kv_pairs.first, _cur_offset, length); | 172 | 1 | ret->get_column(1).insert_many_from(*_kv_pairs.second, _cur_offset, length); | 173 | 1 | } |
|
174 | | |
175 | | template <bool TEXT_MODE> |
176 | 84 | int VJsonEachTableFunction<TEXT_MODE>::get_value(MutableColumnPtr& column, int max_step) { |
177 | 84 | max_step = std::min(max_step, (int)(_cur_size - _cur_offset)); |
178 | | |
179 | 84 | if (current_empty()) { |
180 | 21 | column->insert_default(); |
181 | 21 | max_step = 1; |
182 | 63 | } else { |
183 | 63 | ColumnStruct* struct_col = nullptr; |
184 | 63 | if (_is_nullable) { |
185 | 62 | auto* nullable_col = assert_cast<ColumnNullable*>(column.get()); |
186 | 62 | struct_col = assert_cast<ColumnStruct*>(nullable_col->get_nested_column_ptr().get()); |
187 | 62 | assert_cast<ColumnUInt8*>(nullable_col->get_null_map_column_ptr().get()) |
188 | 62 | ->insert_many_defaults(max_step); |
189 | 62 | } else { |
190 | 1 | struct_col = assert_cast<ColumnStruct*>(column.get()); |
191 | 1 | } |
192 | | |
193 | 63 | struct_col->get_column(0).insert_range_from(*_kv_pairs.first, _cur_offset, max_step); |
194 | 63 | struct_col->get_column(1).insert_range_from(*_kv_pairs.second, _cur_offset, max_step); |
195 | 63 | } |
196 | | |
197 | 84 | forward(max_step); |
198 | 84 | return max_step; |
199 | 84 | } _ZN5doris22VJsonEachTableFunctionILb0EE9get_valueERNS_3COWINS_7IColumnEE11mutable_ptrIS3_EEi Line | Count | Source | 176 | 50 | int VJsonEachTableFunction<TEXT_MODE>::get_value(MutableColumnPtr& column, int max_step) { | 177 | 50 | max_step = std::min(max_step, (int)(_cur_size - _cur_offset)); | 178 | | | 179 | 50 | if (current_empty()) { | 180 | 11 | column->insert_default(); | 181 | 11 | max_step = 1; | 182 | 39 | } else { | 183 | 39 | ColumnStruct* struct_col = nullptr; | 184 | 39 | if (_is_nullable) { | 185 | 38 | auto* nullable_col = assert_cast<ColumnNullable*>(column.get()); | 186 | 38 | struct_col = assert_cast<ColumnStruct*>(nullable_col->get_nested_column_ptr().get()); | 187 | 38 | assert_cast<ColumnUInt8*>(nullable_col->get_null_map_column_ptr().get()) | 188 | 38 | ->insert_many_defaults(max_step); | 189 | 38 | } else { | 190 | 1 | struct_col = assert_cast<ColumnStruct*>(column.get()); | 191 | 1 | } | 192 | | | 193 | 39 | struct_col->get_column(0).insert_range_from(*_kv_pairs.first, _cur_offset, max_step); | 194 | 39 | struct_col->get_column(1).insert_range_from(*_kv_pairs.second, _cur_offset, max_step); | 195 | 39 | } | 196 | | | 197 | 50 | forward(max_step); | 198 | 50 | return max_step; | 199 | 50 | } |
_ZN5doris22VJsonEachTableFunctionILb1EE9get_valueERNS_3COWINS_7IColumnEE11mutable_ptrIS3_EEi Line | Count | Source | 176 | 34 | int VJsonEachTableFunction<TEXT_MODE>::get_value(MutableColumnPtr& column, int max_step) { | 177 | 34 | max_step = std::min(max_step, (int)(_cur_size - _cur_offset)); | 178 | | | 179 | 34 | if (current_empty()) { | 180 | 10 | column->insert_default(); | 181 | 10 | max_step = 1; | 182 | 24 | } else { | 183 | 24 | ColumnStruct* struct_col = nullptr; | 184 | 24 | if (_is_nullable) { | 185 | 24 | auto* nullable_col = assert_cast<ColumnNullable*>(column.get()); | 186 | 24 | struct_col = assert_cast<ColumnStruct*>(nullable_col->get_nested_column_ptr().get()); | 187 | 24 | assert_cast<ColumnUInt8*>(nullable_col->get_null_map_column_ptr().get()) | 188 | 24 | ->insert_many_defaults(max_step); | 189 | 24 | } else { | 190 | 0 | struct_col = assert_cast<ColumnStruct*>(column.get()); | 191 | 0 | } | 192 | | | 193 | 24 | struct_col->get_column(0).insert_range_from(*_kv_pairs.first, _cur_offset, max_step); | 194 | 24 | struct_col->get_column(1).insert_range_from(*_kv_pairs.second, _cur_offset, max_step); | 195 | 24 | } | 196 | | | 197 | 34 | forward(max_step); | 198 | 34 | return max_step; | 199 | 34 | } |
|
200 | | |
201 | | // // Explicit template instantiations |
202 | | template class VJsonEachTableFunction<false>; // json_each |
203 | | template class VJsonEachTableFunction<true>; // json_each_text |
204 | | |
205 | | } // namespace doris |