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

Method WriteIntegerField

cpp/src/arrow/integration/json_internal.cc:661–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659
660 template <typename T>
661 void WriteIntegerField(const char* name, const T* values, int64_t length) {
662 writer_->Key(name);
663 writer_->StartArray();
664 if (sizeof(T) < sizeof(int64_t)) {
665 for (int i = 0; i < length; ++i) {
666 writer_->Int64(values[i]);
667 }
668 } else {
669 // Represent 64-bit integers as strings, as JSON numbers cannot represent
670 // them exactly.
671 ::arrow::internal::StringFormatter<typename CTypeTraits<T>::ArrowType> formatter;
672 auto append = [this](std::string_view v) {
673 writer_->String(v.data(), static_cast<rj::SizeType>(v.size()));
674 return Status::OK();
675 };
676 for (int i = 0; i < length; ++i) {
677 DCHECK_OK(formatter(values[i], append));
678 }
679 }
680 writer_->EndArray();
681 }
682
683 template <typename ArrayType>
684 void WriteBinaryViewField(const ArrayType& array) {

Callers

nothing calls this directly

Calls 8

OKFunction · 0.50
KeyMethod · 0.45
StartArrayMethod · 0.45
Int64Method · 0.45
StringMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
EndArrayMethod · 0.45

Tested by

no test coverage detected