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

Method CheckDirectPut

cpp/src/parquet/encoding_test.cc:2476–2500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2474
2475template <>
2476void 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
2502template <>
2503void TestDeltaByteArrayEncodingDirectPut<FLBAType>::CheckDirectPut(

Callers

nothing calls this directly

Calls 15

AssertArraysEqualFunction · 0.85
default_memory_poolFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.70
MakeBuilderFunction · 0.50
typeMethod · 0.45
PutMethod · 0.45
FlushValuesMethod · 0.45
lengthMethod · 0.45
null_countMethod · 0.45
SetDataMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected