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

Method WriteIntegerField

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

Source from the content-addressed store, hash-verified

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