MCPcopy Create free account
hub / github.com/apache/impala / ArrayValueToJSON

Method ArrayValueToJSON

be/src/runtime/complex-value-writer.inline.h:171–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169// Gets an array value and writes it in JSON format.
170template <class JsonStream>
171void ComplexValueWriter<JsonStream>::ArrayValueToJSON(const CollectionValue& array_value,
172 const TupleDescriptor* item_tuple_desc) {
173 DCHECK(item_tuple_desc != nullptr);
174
175 const int item_byte_size = item_tuple_desc->byte_size();
176 const vector<SlotDescriptor*>& slot_descs = item_tuple_desc->slots();
177
178 DCHECK(slot_descs.size() == 1);
179 DCHECK(slot_descs[0] != nullptr);
180
181 writer_->StartArray();
182
183 for (int i = 0; i < array_value.num_tuples; ++i) {
184 Tuple* item_tuple = reinterpret_cast<Tuple*>(
185 array_value.ptr + i * item_byte_size);
186 const SlotDescriptor& value_slot_desc = *slot_descs[0];
187 CollectionElementToJSON(item_tuple, value_slot_desc, false);
188 }
189
190 writer_->EndArray();
191}
192
193// Gets a map value and writes it in JSON format.
194template <class JsonStream>

Callers

nothing calls this directly

Calls 4

byte_sizeMethod · 0.45
sizeMethod · 0.45
StartArrayMethod · 0.45
EndArrayMethod · 0.45

Tested by

no test coverage detected