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

Function FormatNumericValue

cpp/src/parquet/types.cc:108–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106
107template <typename T>
108std::enable_if_t<std::is_arithmetic_v<T>, std::string> FormatNumericValue(
109 ::std::string_view val) {
110 std::stringstream result;
111 // The statistics value comes from the file's Thrift metadata, so its length
112 // is attacker controlled and the spec allows it to be truncated. Only copy
113 // the bytes that are actually present and leave the rest zero-padded.
114 T value{};
115 std::memcpy(&value, val.data(), std::min(sizeof(T), val.size()));
116 result << value;
117 return result.str();
118}
119
120std::string FormatDecimalValue(Type::type parquet_type, ::std::string_view val,
121 const std::shared_ptr<const LogicalType>& logical_type) {

Callers

nothing calls this directly

Calls 3

strMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected