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

Method CheckEncode

cpp/src/parquet/encoding_test.cc:1540–1556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1538
1539 template <typename U>
1540 void CheckEncode(std::span<const U> data,
1541 std::span<const uint8_t> expected_encoded_data,
1542 const ColumnDescriptor* descr = nullptr) {
1543 static_assert(sizeof(U) == sizeof(c_type));
1544 static_assert(std::is_same_v<U, FLBA> == std::is_same_v<c_type, FLBA>);
1545
1546 std::unique_ptr<TypedEncoder<Type>> encoder = MakeTypedEncoder<Type>(
1547 Encoding::BYTE_STREAM_SPLIT, /*use_dictionary=*/false, descr);
1548 int num_elements = static_cast<int>(data.size());
1549 encoder->Put(reinterpret_cast<const c_type*>(data.data()), num_elements);
1550 auto encoded_data = encoder->FlushValues();
1551 ASSERT_EQ(expected_encoded_data.size(), encoded_data->size());
1552 const uint8_t* encoded_data_raw = encoded_data->data();
1553 for (int64_t i = 0; i < encoded_data->size(); ++i) {
1554 ASSERT_EQ(expected_encoded_data[i], encoded_data_raw[i]);
1555 }
1556 }
1557
1558 int physical_byte_width() const {
1559 return std::is_same_v<c_type, FLBA> ? descr_->type_length()

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
PutMethod · 0.45
dataMethod · 0.45
FlushValuesMethod · 0.45

Tested by

no test coverage detected