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

Method SetData

cpp/src/parquet/decoder.cc:2221–2241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2219 : Base(descr, Encoding::BYTE_STREAM_SPLIT) {}
2220
2221 void SetData(int num_values, const uint8_t* data, int len) final {
2222 // Check that the data size is consistent with the number of values
2223 // The spec requires that the data size is a multiple of the number of values,
2224 // see: https://github.com/apache/parquet-format/pull/192 .
2225 // GH-41562: passed in `num_values` may include nulls, so we need to check and
2226 // adjust the number of values.
2227 if (static_cast<int64_t>(num_values) * this->type_length_ < len) {
2228 throw ParquetException(
2229 "Data size (" + std::to_string(len) +
2230 ") is too small for the number of values in in BYTE_STREAM_SPLIT (" +
2231 std::to_string(num_values) + ")");
2232 }
2233 if (len % this->type_length_ != 0) {
2234 throw ParquetException("ByteStreamSplit data size " + std::to_string(len) +
2235 " not aligned with type " + TypeToString(DType::type_num) +
2236 " and byte width: " + std::to_string(this->type_length_));
2237 }
2238 num_values = len / this->type_length_;
2239 Base::SetData(num_values, data, len);
2240 stride_ = this->num_values_;
2241 }
2242
2243 int DecodeArrow(int num_values, int null_count, const uint8_t* valid_bits,
2244 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