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

Method DecodeIndices

cpp/src/parquet/decoder.cc:962–979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

960 }
961
962 int DecodeIndices(int num_values, ::arrow::ArrayBuilder* builder) override {
963 num_values = std::min(num_values, this->num_values_);
964 if (num_values > 0) {
965 // TODO(wesm): Refactor to batch reads for improved memory use. This is
966 // relatively simple here because we don't have to do any bookkeeping of
967 // nulls
968 PARQUET_THROW_NOT_OK(indices_scratch_space_->TypedResize<int32_t>(
969 num_values, /*shrink_to_fit=*/false));
970 }
971 auto indices_buffer = indices_scratch_space_->mutable_data_as<int32_t>();
972 if (num_values != idx_decoder_.GetBatch(indices_buffer, num_values)) {
973 ParquetException::EofException();
974 }
975 auto binary_builder = checked_cast<::arrow::BinaryDictionary32Builder*>(builder);
976 PARQUET_THROW_NOT_OK(binary_builder->AppendIndices(indices_buffer, num_values));
977 this->num_values_ -= num_values;
978 return num_values;
979 }
980
981 int DecodeIndices(int num_values, int32_t* indices) override {
982 if (num_values != idx_decoder_.GetBatch(indices, num_values)) {

Callers 3

ReadDictionaryIndicesMethod · 0.80
ReadValuesDenseMethod · 0.80
TEST_FFunction · 0.80

Calls 2

GetBatchMethod · 0.45
AppendIndicesMethod · 0.45

Tested by 1

TEST_FFunction · 0.64