79 FileFormatType file_format = FileFormatType::kParquet;
86 int64_t record_count = 0;
89 int64_t file_size_in_bytes = 0;
189 static constexpr int32_t kContentFieldId = 134;
190 inline static const SchemaField kContent = SchemaField::MakeOptional(
191 kContentFieldId,
"content",
int32(),
192 "Contents of the file: 0=data, 1=position deletes, 2=equality deletes");
194 static constexpr int32_t kFilePathFieldId = 100;
195 inline static const SchemaField kFilePath = SchemaField::MakeRequired(
196 kFilePathFieldId,
"file_path",
string(),
"Location URI with FS scheme");
198 static constexpr int32_t kFileFormatFieldId = 101;
200 SchemaField::MakeRequired(kFileFormatFieldId,
"file_format",
string(),
201 "File format name: avro, orc, or parquet");
203 static constexpr int32_t kSpecIdFieldId = 141;
205 SchemaField::MakeOptional(kSpecIdFieldId,
"spec_id",
int32(),
"Partition spec ID");
207 static constexpr int32_t kPartitionFieldId = 102;
208 inline static const std::string kPartitionField =
"partition";
209 inline static const std::string kPartitionDoc =
210 "Partition data tuple, schema based on the partition spec";
212 static constexpr int32_t kRecordCountFieldId = 103;
213 inline static const SchemaField kRecordCount = SchemaField::MakeRequired(
214 kRecordCountFieldId,
"record_count",
int64(),
"Number of records in the file");
216 static constexpr int32_t kFileSizeFieldId = 104;
217 inline static const SchemaField kFileSize = SchemaField::MakeRequired(
218 kFileSizeFieldId,
"file_size_in_bytes",
int64(),
"Total file size in bytes");
220 static constexpr int32_t kColumnSizesFieldId = 108;
221 inline static const SchemaField kColumnSizes = SchemaField::MakeOptional(
222 kColumnSizesFieldId,
"column_sizes",
223 map(SchemaField::MakeRequired(117, std::string(MapType::kKeyName),
int32()),
224 SchemaField::MakeRequired(118, std::string(MapType::kValueName),
int64())),
225 "Map of column id to total size on disk");
227 static constexpr int32_t kValueCountsFieldId = 109;
228 inline static const SchemaField kValueCounts = SchemaField::MakeOptional(
229 kValueCountsFieldId,
"value_counts",
230 map(SchemaField::MakeRequired(119, std::string(MapType::kKeyName),
int32()),
231 SchemaField::MakeRequired(120, std::string(MapType::kValueName),
int64())),
232 "Map of column id to total count, including null and NaN");
234 static constexpr int32_t kNullValueCountsFieldId = 110;
235 inline static const SchemaField kNullValueCounts = SchemaField::MakeOptional(
236 kNullValueCountsFieldId,
"null_value_counts",
237 map(SchemaField::MakeRequired(121, std::string(MapType::kKeyName),
int32()),
238 SchemaField::MakeRequired(122, std::string(MapType::kValueName),
int64())),
239 "Map of column id to null value count");
241 static constexpr int32_t kNanValueCountsFieldId = 137;
242 inline static const SchemaField kNanValueCounts = SchemaField::MakeOptional(
243 kNanValueCountsFieldId,
"nan_value_counts",
244 map(SchemaField::MakeRequired(138, std::string(MapType::kKeyName),
int32()),
245 SchemaField::MakeRequired(139, std::string(MapType::kValueName),
int64())),
246 "Map of column id to number of NaN values in the column");
248 static constexpr int32_t kLowerBoundsFieldId = 125;
249 inline static const SchemaField kLowerBounds = SchemaField::MakeOptional(
250 kLowerBoundsFieldId,
"lower_bounds",
251 map(SchemaField::MakeRequired(126, std::string(MapType::kKeyName),
int32()),
252 SchemaField::MakeRequired(127, std::string(MapType::kValueName),
binary())),
253 "Map of column id to lower bound");
255 static constexpr int32_t kUpperBoundsFieldId = 128;
256 inline static const SchemaField kUpperBounds = SchemaField::MakeOptional(
257 kUpperBoundsFieldId,
"upper_bounds",
258 map(SchemaField::MakeRequired(129, std::string(MapType::kKeyName),
int32()),
259 SchemaField::MakeRequired(130, std::string(MapType::kValueName),
binary())),
260 "Map of column id to upper bound");
262 static constexpr int32_t kKeyMetadataFieldId = 131;
263 inline static const SchemaField kKeyMetadata = SchemaField::MakeOptional(
264 kKeyMetadataFieldId,
"key_metadata",
binary(),
"Encryption key metadata blob");
266 static constexpr int32_t kSplitOffsetsFieldId = 132;
267 inline static const SchemaField kSplitOffsets = SchemaField::MakeOptional(
268 kSplitOffsetsFieldId,
"split_offsets",
269 list(SchemaField::MakeRequired(133, std::string(ListType::kElementName),
int64())),
270 "Splittable offsets");
272 static constexpr int32_t kEqualityIdsFieldId = 135;
273 inline static const SchemaField kEqualityIds = SchemaField::MakeOptional(
274 kEqualityIdsFieldId,
"equality_ids",
275 list(SchemaField::MakeRequired(136, std::string(ListType::kElementName),
int32())),
276 "Equality comparison field IDs");
278 static constexpr int32_t kSortOrderIdFieldId = 140;
279 inline static const SchemaField kSortOrderId = SchemaField::MakeOptional(
280 kSortOrderIdFieldId,
"sort_order_id",
int32(),
"Sort order ID");
282 static constexpr int32_t kFirstRowIdFieldId = 142;
284 SchemaField::MakeOptional(kFirstRowIdFieldId,
"first_row_id",
int64(),
285 "Starting row ID to assign to new rows");
287 static constexpr int32_t kReferencedDataFileFieldId = 143;
288 inline static const SchemaField kReferencedDataFile = SchemaField::MakeOptional(
289 kReferencedDataFileFieldId,
"referenced_data_file",
string(),
290 "Fully qualified location (URI with FS scheme) of a data file that all deletes "
293 static constexpr int32_t kContentOffsetFieldId = 144;
295 SchemaField::MakeOptional(kContentOffsetFieldId,
"content_offset",
int64(),
296 "The offset in the file where the content starts");
298 static constexpr int32_t kContentSizeFieldId = 145;
300 SchemaField::MakeOptional(kContentSizeFieldId,
"content_size_in_bytes",
int64(),
301 "The length of referenced content stored in the file");
303 bool operator==(
const DataFile& other)
const =
default;
306 static std::shared_ptr<StructType>
Type(std::shared_ptr<StructType> partition_type);
310 return content == Content::kPositionDeletes && file_format == FileFormatType::kPuffin;
322 ManifestStatus status = ManifestStatus::kAdded;
357 static constexpr int32_t kStatusFieldId = 0;
359 SchemaField::MakeRequired(kStatusFieldId,
"status",
int32());
361 static constexpr int32_t kSnapshotIdFieldId = 1;
363 SchemaField::MakeOptional(kSnapshotIdFieldId,
"snapshot_id",
int64());
365 static constexpr int32_t kDataFileFieldId = 2;
366 inline static const std::string kDataFileField =
"data_file";
368 static constexpr int32_t kSequenceNumberFieldId = 3;
370 SchemaField::MakeOptional(kSequenceNumberFieldId,
"sequence_number",
int64());
372 static constexpr int32_t kFileSequenceNumberFieldId = 4;
373 inline static const SchemaField kFileSequenceNumber = SchemaField::MakeOptional(
374 kFileSequenceNumberFieldId,
"file_sequence_number",
int64());
378 return status == ManifestStatus::kAdded || status == ManifestStatus::kExisting;
383 copy.
status = ManifestStatus::kAdded;
386 copy.
data_file->first_row_id = std::nullopt;
391 ManifestEntry AsExisting()
const {
392 ManifestEntry copy = *
this;
393 copy.
status = ManifestStatus::kExisting;
397 ManifestEntry AsDeleted()
const {
398 ManifestEntry copy = *
this;
399 copy.
status = ManifestStatus::kDeleted;
403 bool operator==(
const ManifestEntry& other)
const;
405 static std::shared_ptr<StructType> TypeFromPartitionType(
406 std::shared_ptr<StructType> partition_type);
407 static std::shared_ptr<StructType> TypeFromDataFileType(
408 std::shared_ptr<StructType> datafile_type);
A manifest is an immutable Avro file that lists data files or delete files, along with each file's pa...
Definition manifest_entry.h:318
std::optional< int64_t > snapshot_id
Definition manifest_entry.h:326
std::optional< int64_t > file_sequence_number
Definition manifest_entry.h:352
std::optional< int64_t > sequence_number
Definition manifest_entry.h:339
constexpr bool IsAlive() const
Check if this manifest entry is deleted.
Definition manifest_entry.h:377
std::shared_ptr< DataFile > data_file
Definition manifest_entry.h:355
ManifestStatus status
Definition manifest_entry.h:322