Creates an Iceberg data file FlatBuffer for regular (non-puffin) data files.
| 668 | |
| 669 | // Creates an Iceberg data file FlatBuffer for regular (non-puffin) data files. |
| 670 | string createIcebergDataFileString( |
| 671 | const OutputPartition& partition, const string& final_path, int64_t num_rows, |
| 672 | int64_t file_size, const IcebergFileStats& insert_stats) { |
| 673 | using namespace org::apache::impala::fb; |
| 674 | flatbuffers::FlatBufferBuilder fbb; |
| 675 | |
| 676 | vector<flatbuffers::Offset<FbIcebergColumnStats>> ice_col_stats_vec; |
| 677 | for (auto it = insert_stats.cbegin(); it != insert_stats.cend(); ++it) { |
| 678 | ice_col_stats_vec.push_back(createIcebergColumnStats(fbb, it->first, it->second)); |
| 679 | } |
| 680 | |
| 681 | auto raw_partition_fields = createRawPartitionFields(fbb, partition); |
| 682 | |
| 683 | flatbuffers::Offset<FbIcebergDataFile> data_file = CreateFbIcebergDataFile(fbb, |
| 684 | fbb.CreateString(final_path), |
| 685 | FbIcebergDataFileFormat::FbIcebergDataFileFormat_PARQUET, |
| 686 | num_rows, |
| 687 | file_size, |
| 688 | partition.iceberg_spec_id, |
| 689 | fbb.CreateString(partition.partition_name), |
| 690 | fbb.CreateVector(raw_partition_fields), |
| 691 | fbb.CreateVector(ice_col_stats_vec), |
| 692 | 0, // No old_deletion_vector for regular files |
| 693 | 0); // No new_deletion_vector for regular files |
| 694 | fbb.Finish(data_file); |
| 695 | return string(reinterpret_cast<char*>(fbb.GetBufferPointer()), fbb.GetSize()); |
| 696 | } |
| 697 | |
| 698 | } |
| 699 |
no test coverage detected