| 330 | |
| 331 | template <bool has_repeated_parent> |
| 332 | void DefLevelsToBitmapSimd(const int16_t* def_levels, int64_t num_def_levels, |
| 333 | LevelInfo level_info, ValidityBitmapInputOutput* output) { |
| 334 | ::arrow::internal::FirstTimeBitmapWriter writer( |
| 335 | output->valid_bits, |
| 336 | /*start_offset=*/output->valid_bits_offset, |
| 337 | /*length=*/output->values_read_upper_bound); |
| 338 | int64_t set_count = 0; |
| 339 | output->values_read = 0; |
| 340 | int64_t values_read_remaining = output->values_read_upper_bound; |
| 341 | while (num_def_levels > kExtractBitsSize) { |
| 342 | set_count += DefLevelsBatchToBitmap<has_repeated_parent>( |
| 343 | def_levels, kExtractBitsSize, values_read_remaining, level_info, &writer); |
| 344 | def_levels += kExtractBitsSize; |
| 345 | num_def_levels -= kExtractBitsSize; |
| 346 | values_read_remaining = output->values_read_upper_bound - writer.position(); |
| 347 | } |
| 348 | set_count += DefLevelsBatchToBitmap<has_repeated_parent>( |
| 349 | def_levels, num_def_levels, values_read_remaining, level_info, &writer); |
| 350 | |
| 351 | output->values_read = writer.position(); |
| 352 | output->null_count += output->values_read - set_count; |
| 353 | writer.Finish(); |
| 354 | } |
| 355 | |
| 356 | } // namespace parquet::internal::PARQUET_IMPL_NAMESPACE |