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

Method PutBinaryArray

cpp/src/parquet/encoder.cc:182–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180 protected:
181 template <typename ArrayType>
182 void PutBinaryArray(const ArrayType& array) {
183 const int64_t total_bytes = GetBinaryDataSize(array);
184 PARQUET_THROW_NOT_OK(sink_.Reserve(total_bytes + array.length() * sizeof(uint32_t)));
185
186 PARQUET_THROW_NOT_OK(::arrow::VisitArraySpanInline<typename ArrayType::TypeClass>(
187 *array.data(),
188 [&](::std::string_view view) {
189 if (ARROW_PREDICT_FALSE(view.size() > kMaxByteArraySize)) {
190 return Status::Invalid(
191 "Parquet cannot store strings with size 2GB or more, got: ", view.size());
192 }
193 UnsafePutByteArray(view.data(), static_cast<uint32_t>(view.size()));
194 return Status::OK();
195 },
196 []() { return Status::OK(); }));
197 }
198
199 ::arrow::BufferBuilder sink_;
200};

Callers

nothing calls this directly

Calls 7

GetBinaryDataSizeFunction · 0.85
InvalidFunction · 0.50
OKFunction · 0.50
ReserveMethod · 0.45
lengthMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected