MCPcopy Create free account
hub / github.com/apache/arrow / WriteListScalar

Function WriteListScalar

cpp/src/arrow/flight/sql/odbc/odbc_impl/json_converter.cc:58–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57template <typename ListScalarT>
58Status WriteListScalar(const ListScalarT& scalar,
59 rapidjson::Writer<rapidjson::StringBuffer>& writer,
60 ScalarVisitor* visitor) {
61 writer.StartArray();
62 for (int64_t i = 0; i < scalar.value->length(); ++i) {
63 if (scalar.value->IsNull(i)) {
64 writer.Null();
65 } else {
66 const auto& result = scalar.value->GetScalar(i);
67 ThrowIfNotOK(result.status());
68 ThrowIfNotOK(result.ValueOrDie()->Accept(visitor));
69 }
70 }
71
72 writer.EndArray();
73 return Status::OK();
74}
75
76class ScalarToJson : public ScalarVisitor {
77 private:

Callers 1

VisitMethod · 0.85

Calls 11

ThrowIfNotOKFunction · 0.85
ValueOrDieMethod · 0.80
OKFunction · 0.50
StartArrayMethod · 0.45
lengthMethod · 0.45
IsNullMethod · 0.45
NullMethod · 0.45
GetScalarMethod · 0.45
statusMethod · 0.45
AcceptMethod · 0.45
EndArrayMethod · 0.45

Tested by

no test coverage detected