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

Method FindFirst

cpp/src/arrow/json/chunker.cc:127–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125class ParsingBoundaryFinder : public BoundaryFinder {
126 public:
127 Status FindFirst(string_view partial, string_view block, int64_t* out_pos) override {
128 auto length = ConsumeWholeObject(MultiStringStream({partial, block}));
129 if (length == string_view::npos) {
130 *out_pos = -1;
131 } else if (ARROW_PREDICT_FALSE(length < partial.size())) {
132 return Status::Invalid("JSON chunk error: invalid data at end of document");
133 } else {
134 DCHECK_LE(length, partial.size() + block.size());
135 *out_pos = static_cast<int64_t>(length - partial.size());
136 }
137 return Status::OK();
138 }
139
140 Status FindLast(std::string_view block, int64_t* out_pos) override {
141 const size_t block_length = block.size();

Callers

nothing calls this directly

Calls 5

MultiStringStreamClass · 0.85
ConsumeWholeObjectFunction · 0.70
OKFunction · 0.70
InvalidFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected