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

Function ConvertNumber

cpp/src/arrow/json/from_string.cc:189–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187// Convert single signed integer value (also {Date,Time}{32,64} and Timestamp)
188template <typename T>
189enable_if_physical_signed_integer<T, Status> ConvertNumber(sj::value& json_obj,
190 const DataType& type,
191 typename T::c_type* out) {
192 *out = static_cast<typename T::c_type>(0);
193 ARROW_ASSIGN_OR_RAISE(int64_t v64, internal::GetJsonAs<int64_t>(json_obj));
194 *out = static_cast<typename T::c_type>(v64);
195 if (*out == v64) {
196 return Status::OK();
197 } else {
198 return Status::Invalid("Value ", v64, " out of bounds for ", type);
199 }
200}
201
202// Convert single unsigned integer value
203template <typename T>

Callers

nothing calls this directly

Calls 5

OKFunction · 0.70
InvalidFunction · 0.50
Float16Function · 0.50
valueMethod · 0.45

Tested by

no test coverage detected