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

Method SetData

cpp/src/parquet/decoder.cc:2249–2269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2247 : Base(descr, Encoding::BYTE_STREAM_SPLIT) {}
2248
2249 void SetData(int num_values, const uint8_t* data, int len) final {
2250 // Check that the data size is consistent with the number of values
2251 // The spec requires that the data size is a multiple of the number of values,
2252 // see: https://github.com/apache/parquet-format/pull/192 .
2253 // GH-41562: passed in `num_values` may include nulls, so we need to check and
2254 // adjust the number of values.
2255 if (static_cast<int64_t>(num_values) * this->type_length_ < len) {
2256 throw ParquetException(
2257 "Data size (" + std::to_string(len) +
2258 ") is too small for the number of values in in BYTE_STREAM_SPLIT (" +
2259 std::to_string(num_values) + ")");
2260 }
2261 if (len % this->type_length_ != 0) {
2262 throw ParquetException("ByteStreamSplit data size " + std::to_string(len) +
2263 " not aligned with type " + TypeToString(DType::type_num) +
2264 " and byte width: " + std::to_string(this->type_length_));
2265 }
2266 num_values = len / this->type_length_;
2267 Base::SetData(num_values, data, len);
2268 stride_ = this->num_values_;
2269 }
2270
2271 int DecodeArrow(int num_values, int null_count, const uint8_t* valid_bits,
2272 int64_t valid_bits_offset,

Callers

nothing calls this directly

Calls 4

ParquetExceptionFunction · 0.85
to_stringFunction · 0.85
TypeToStringFunction · 0.85
SetDataFunction · 0.50

Tested by

no test coverage detected