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

Method SetData

cpp/src/parquet/decoder.cc:1861–1884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1859 : TypedDecoderImpl<BooleanType>(descr, Encoding::RLE) {}
1860
1861 void SetData(int num_values, const uint8_t* data, int len) override {
1862 num_values_ = num_values;
1863 uint32_t num_bytes = 0;
1864
1865 if (len < 4) {
1866 throw ParquetException("Received invalid length : " + std::to_string(len) +
1867 " (corrupt data page?)");
1868 }
1869 // Load the first 4 bytes in little-endian, which indicates the length
1870 num_bytes = ::arrow::bit_util::FromLittleEndian(SafeLoadAs<uint32_t>(data));
1871 if (num_bytes < 0 || num_bytes > static_cast<uint32_t>(len - 4)) {
1872 throw ParquetException("Received invalid number of bytes : " +
1873 std::to_string(num_bytes) + " (corrupt data page?)");
1874 }
1875
1876 auto decoder_data = data + 4;
1877 if (decoder_ == nullptr) {
1878 decoder_ = std::make_shared<::arrow::util::RleBitPackedDecoder<bool>>(
1879 decoder_data, num_bytes,
1880 /*bit_width=*/1);
1881 } else {
1882 decoder_->Reset(decoder_data, num_bytes, /*bit_width=*/1);
1883 }
1884 }
1885
1886 int Decode(bool* buffer, int max_values) override {
1887 max_values = std::min(max_values, num_values_);

Callers

nothing calls this directly

Calls 4

ParquetExceptionFunction · 0.85
to_stringFunction · 0.85
FromLittleEndianFunction · 0.50
ResetMethod · 0.45

Tested by

no test coverage detected