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

Method DecodeArrowDense

cpp/src/parquet/decoder.cc:1785–1820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1783 }
1784
1785 Status DecodeArrowDense(int num_values, int null_count, const uint8_t* valid_bits,
1786 int64_t valid_bits_offset,
1787 typename EncodingTraits<ByteArrayType>::Accumulator* out,
1788 int* out_num_values) {
1789 std::vector<ByteArray> values(num_values - null_count);
1790 const int num_valid_values = Decode(values.data(), num_values - null_count);
1791 if (ARROW_PREDICT_FALSE(num_values - null_count != num_valid_values)) {
1792 throw ParquetException("Expected to decode ", num_values - null_count,
1793 " values, but decoded ", num_valid_values, " values.");
1794 }
1795
1796 auto visit_binary_helper = [&](auto* helper) {
1797 auto values_ptr = values.data();
1798 int value_idx = 0;
1799
1800 RETURN_NOT_OK(
1801 VisitBitRuns(valid_bits, valid_bits_offset, num_values,
1802 [&](int64_t position, int64_t run_length, bool is_valid) {
1803 if (is_valid) {
1804 for (int64_t i = 0; i < run_length; ++i) {
1805 const auto& val = values_ptr[value_idx];
1806 RETURN_NOT_OK(helper->AppendValue(
1807 val.ptr, static_cast<int32_t>(val.len)));
1808 ++value_idx;
1809 }
1810 return Status::OK();
1811 } else {
1812 return helper->AppendNulls(run_length);
1813 }
1814 }));
1815 *out_num_values = num_valid_values;
1816 return Status::OK();
1817 };
1818 return DispatchArrowBinaryHelper<ByteArrayType>(
1819 out, num_values, /*estimated_data_length=*/{}, visit_binary_helper);
1820 }
1821
1822 std::shared_ptr<::arrow::bit_util::BitReader> decoder_;
1823 DeltaBitPackDecoder<Int32Type> len_decoder_;

Callers

nothing calls this directly

Calls 7

ParquetExceptionFunction · 0.85
VisitBitRunsFunction · 0.85
DecodeFunction · 0.70
OKFunction · 0.50
dataMethod · 0.45
AppendValueMethod · 0.45
AppendNullsMethod · 0.45

Tested by

no test coverage detected