| 545 | |
| 546 | namespace { |
| 547 | flatbuffers::Offset<org::apache::impala::fb::FbIcebergColumnStats> |
| 548 | createIcebergColumnStats( |
| 549 | flatbuffers::FlatBufferBuilder& fbb, int field_id, |
| 550 | const IcebergColumnStats& col_stats) { |
| 551 | using namespace org::apache::impala::fb; |
| 552 | |
| 553 | flatbuffers::Offset<flatbuffers::Vector<uint8_t>> lower_bound; |
| 554 | flatbuffers::Offset<flatbuffers::Vector<uint8_t>> upper_bound; |
| 555 | if (col_stats.has_min_max_values) { |
| 556 | const std::string& min_binary = col_stats.min_binary; |
| 557 | const uint8_t* data = reinterpret_cast<const uint8_t*>(min_binary.data()); |
| 558 | lower_bound = fbb.CreateVector(data, min_binary.size()); |
| 559 | |
| 560 | const std::string& max_binary = col_stats.max_binary; |
| 561 | data = reinterpret_cast<const uint8_t*>(max_binary.data()); |
| 562 | upper_bound = fbb.CreateVector(data, max_binary.size()); |
| 563 | } |
| 564 | |
| 565 | FbIcebergColumnStatsBuilder stats_builder(fbb); |
| 566 | stats_builder.add_field_id(field_id); |
| 567 | |
| 568 | stats_builder.add_total_compressed_byte_size(col_stats.column_size); |
| 569 | stats_builder.add_value_count(col_stats.value_count); |
| 570 | stats_builder.add_null_count(col_stats.null_count); |
| 571 | |
| 572 | if (col_stats.has_min_max_values) { |
| 573 | stats_builder.add_lower_bound(lower_bound); |
| 574 | stats_builder.add_upper_bound(upper_bound); |
| 575 | } |
| 576 | |
| 577 | return stats_builder.Finish(); |
| 578 | } |
| 579 | |
| 580 | vector<flatbuffers::Offset<org::apache::impala::fb::FbIcebergPartitionField>> |
| 581 | createRawPartitionFields(flatbuffers::FlatBufferBuilder& fbb, |
no test coverage detected