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

Function DecodePlain

cpp/src/parquet/decoder.cc:456–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

454// Decode routine templated on C++ type rather than type enum
455template <typename T>
456inline int DecodePlain(const uint8_t* data, int64_t data_size, int num_values,
457 int type_length, T* out) {
458 int64_t bytes_to_decode = num_values * static_cast<int64_t>(sizeof(T));
459 if (bytes_to_decode > data_size || bytes_to_decode > INT_MAX) {
460 ParquetException::EofException();
461 }
462 // If bytes_to_decode == 0, data could be null
463 if (bytes_to_decode > 0) {
464 memcpy(out, data, static_cast<size_t>(bytes_to_decode));
465 }
466 return static_cast<int>(bytes_to_decode);
467}
468
469// Template specialization for BYTE_ARRAY. The written values do not own their
470// own data.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected