| 2474 | |
| 2475 | template <> |
| 2476 | void TestDeltaByteArrayEncodingDirectPut<ByteArrayType>::CheckDirectPut( |
| 2477 | std::shared_ptr<::arrow::Array> array) { |
| 2478 | MakeEncoderDecoder(*array->type()); |
| 2479 | |
| 2480 | ASSERT_NO_THROW(encoder->Put(*array)); |
| 2481 | auto buf = encoder->FlushValues(); |
| 2482 | |
| 2483 | int num_values = static_cast<int>(array->length() - array->null_count()); |
| 2484 | decoder->SetData(num_values, buf->data(), static_cast<int>(buf->size())); |
| 2485 | |
| 2486 | Accumulator acc; |
| 2487 | ASSERT_OK_AND_ASSIGN(acc.builder, ::arrow::MakeBuilder(array->type())); |
| 2488 | |
| 2489 | ASSERT_EQ(num_values, |
| 2490 | decoder->DecodeArrow(static_cast<int>(array->length()), |
| 2491 | static_cast<int>(array->null_count()), |
| 2492 | array->null_bitmap_data(), array->offset(), &acc)); |
| 2493 | |
| 2494 | ASSERT_EQ(acc.chunks.size(), 0) << "Accumulator shouldn't have overflowed chunks"; |
| 2495 | ASSERT_OK_AND_ASSIGN(auto result, acc.builder->Finish()); |
| 2496 | ASSERT_EQ(array->length(), result->length()); |
| 2497 | ASSERT_OK(result->ValidateFull()); |
| 2498 | |
| 2499 | ::arrow::AssertArraysEqual(*array, *result); |
| 2500 | } |
| 2501 | |
| 2502 | template <> |
| 2503 | void TestDeltaByteArrayEncodingDirectPut<FLBAType>::CheckDirectPut( |
nothing calls this directly
no test coverage detected