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

Method Write

cpp/src/arrow/dataset/file_json_test.cc:120–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118 using FormatType = JsonFileFormat;
119
120 static Result<std::shared_ptr<Buffer>> Write(RecordBatchReader* reader) {
121 ARROW_ASSIGN_OR_RAISE(auto scalars, ToScalars(reader));
122 std::stringstream ss;
123
124 for (const auto& scalar : scalars) {
125 ::arrow::internal::JsonWriter writer;
126 RETURN_NOT_OK(WriteJson(*scalar, &writer));
127
128 ARROW_ASSIGN_OR_RAISE(auto json, writer.GetString());
129 ss << json << "\n";
130 }
131 return Buffer::FromString(ss.str());
132 }
133
134 static std::shared_ptr<FormatType> MakeFormat() {
135 return std::make_shared<FormatType>();

Callers

nothing calls this directly

Calls 3

WriteJsonFunction · 0.85
FromStringFunction · 0.85
strMethod · 0.80

Tested by

no test coverage detected