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

Method CheckDecodeArrow

cpp/src/parquet/encoding_test.cc:792–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

790 }
791
792 void CheckDecodeArrow(Encoding::type encoding) {
793 for (double np : null_probabilities_) {
794 for (double true_prob : true_probabilities_) {
795 InitTestCase(encoding, np, true_prob);
796 for (int read_batch_size : this->read_batch_sizes_) {
797 ResetTheDecoder();
798
799 int num_values_left = kNumValues;
800 ::arrow::BooleanBuilder acc;
801 int actual_num_not_null_values = 0;
802 while (num_values_left > 0) {
803 int batch_size = std::min(num_values_left, read_batch_size);
804 ASSERT_NE(0, batch_size);
805 // Counting nulls
806 int64_t batch_null_count = 0;
807 if (null_count_ != 0) {
808 batch_null_count =
809 batch_size - ::arrow::internal::CountSetBits(
810 valid_bits_, kNumValues - num_values_left, batch_size);
811 }
812 int batch_num_values =
813 decoder_->DecodeArrow(batch_size, static_cast<int>(batch_null_count),
814 valid_bits_, kNumValues - num_values_left, &acc);
815 actual_num_not_null_values += batch_num_values;
816 num_values_left -= batch_size;
817 }
818 std::shared_ptr<::arrow::Array> chunk;
819 ASSERT_OK(acc.Finish(&chunk));
820 CheckDense(actual_num_not_null_values, *chunk);
821 }
822 }
823 }
824 }
825
826 void CheckDecodeArrowNonNull(Encoding::type encoding) {
827 // NonNull skips tests for null_prob != 0.

Callers 1

TEST_FFunction · 0.80

Calls 3

CountSetBitsFunction · 0.50
DecodeArrowMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected