Skip to content

SPEC: Add File Type to v4 spec - #17918

Merged
danielcweeks merged 2 commits into
apache:mainfrom
danielcweeks:v4/file-type-spec
Oct 19, 2026
Merged

danielcweeks merged 2 commits into
apache:mainfrom
danielcweeks:v4/file-type-spec

Conversation

@danielcweeks

Copy link
Copy Markdown
Contributor

This PR adds language for the File type as defined in Parquet for V4.

@github-actions github-actions Bot added the Specification Issues that may introduce spec changes. label Sep 1, 2026
@danielcweeks danielcweeks mentioned this pull request Sep 1, 2026
1 of 6 tasks
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated

Adding a `file` field reserves the root field's ID plus six consecutive IDs for its sub-fields, assigned by the offsets above. Writers must advance `last-column-id` past all seven IDs and must not assign these IDs to any other field.

A `file` value has no whole-value statistics. Each sub-field's statistics are tracked in `content_stats` under the sub-field's reserved ID, as for any field of the sub-field's type. Writers should produce statistics for `uri`, `content_type`, and `inline` fields; other fields may be omitted.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline is the raw referenced bytes. Upper/lower bounds are potentially large and not useful for data skipping. The Delta RFC deliberately collects minValues/maxValues on uri, offset, size, content_type and explicitly excludes inline (and excludes checksum from min/max because a digest is uniformly distributed).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline value is truncated per the bytes type. We felt it was useful to determine if there are inline or out-of-line values. You could omit the lower/upper bounds, but the value counts/nulls are meaningful.

Size and offset may be less important overall (offset is largely useless).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aligned the Delta RFC delta-io/delta#7148 to include value counts/nulls for all fields.

This comment was marked as duplicate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevenzwu can you clarify? This thread didn't say we were dropping those fields. I'm not sure I follow.

We're also not restricting or requiring specific stats or fields as they're all optional, so I don't follow your comment and it seems that further specification isn't necessary.

@stevenzwu stevenzwu Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the confusion.

The sub-fields are implicit: they are not represented in the Iceberg schema

if a sub field is not in the table schema, I thought it can't be stored in content_stats.

Adding a file field reserves the root field's ID plus six consecutive IDs for its sub-fields, assigned by the offsets above. Writers must advance last-column-id past all seven IDs and must not assign these IDs to any other field.

later the spec talked about last-column-id advancement rule. that is where I got a bit confused. Are we saying those are stats fields (with assigned field id) like Ryan's stats-only fields proposal? if that's the missing gap, it might be good to connect the dots in the spec text.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All subfields have field ids and therefore can be represented in the content stats. There's no requirement that a field be represented in the schema to have stats; all that's required is to have a field-id so it can be represented.

Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
dejankrak-db added a commit to dejankrak-db/delta that referenced this pull request Sep 9, 2026
…stats; reserved sub-field field IDs

Per Anoop's review and the Iceberg FILE type spec (apache/iceberg#17918):
- Collect nullCount on all sub-fields including inline (matches Iceberg per-sub-field
  null/value count for inline); min/max still only on uri/offset/size/content_type.
- Document reserved sub-field field IDs at fixed offsets (uri +1 through inline +6); a file
  column reserves 7 consecutive IDs and advances maxColumnId, matching Iceberg so field IDs
  align under AMT / field-id-keyed stats.
- Separate addressable-in-expressions (all but inline) from has-statistics (all leaves).

Co-authored-by: Isaac <no-reply@databricks.com>
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
@danielcweeks danielcweeks changed the title [SPEC] Add File Type to v4 spec SPEC: Add File Type to v4 spec Sep 10, 2026
This was referenced Sep 24, 2026
@RussellSpitzer

Copy link
Copy Markdown
Member

Added the minimal first step of implementation of this in #18252 which I believe matches this spec as written.

Comment thread format/spec.md Outdated
Comment thread format/spec.md
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated

Adding a `file` field reserves the root field's ID plus six consecutive IDs for its sub-fields, assigned by the offsets above. Writers must advance `last-column-id` past all seven IDs and must not assign these IDs to any other field.

A `file` value has no whole-value statistics. Each sub-field's statistics are tracked in `content_stats` under the sub-field's reserved ID, as for any field of the sub-field's type. Writers should produce statistics for `uri`, `content_type`, and `inline` fields; other fields may be omitted.

This comment was marked as duplicate.

Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md Outdated
Comment thread format/spec.md
Comment thread format/spec.md Outdated
@Kurtiscwright

Copy link
Copy Markdown
Contributor

@Kurtiscwright This can't be addressed at the type-definition level. Ownership and maintenance is a responsibility of the Catalog and who runts the maintenance procedure. The catalog should protect data access from secondary references trying to delete, but it's not a property of the type.

@danielcweeks I tried to stay away from the terminology Ownership because our community sync discussions made it clear that term invokes a lot of extra requirements outside the Specification scope of a data type.

I do think it's in Specification scope to have a well defined field, so it's cross catalog and cross engine, that can be used by a Maintenance operation to guide the correct decision on orphan clean up. I think this should be in the type definition because each entry in a table could be different, meaning in one row the file type could be something maintenance cleans up while the next is a file reference stored in multiple tables.

Separately I don't think it's a safe assumption that a table will mostly or only have files co-located/relative with a table. Especially with S3 Buckets being global.

Co-authored-by: Daniel Weeks <danielcweeks@users.noreply.github.com>
Co-authored-by: Russell Spitzer <RussellSpitzer@users.noreply.github.com>
Co-authored-by: Talat Uyarer <talatuyarer@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
@danielcweeks

Copy link
Copy Markdown
Contributor Author

@Kurtiscwright This can't be addressed at the type-definition level. Ownership and maintenance is a responsibility of the Catalog and who runts the maintenance procedure. The catalog should protect data access from secondary references trying to delete, but it's not a property of the type.

@danielcweeks I tried to stay away from the terminology Ownership because our community sync discussions made it clear that term invokes a lot of extra requirements outside the Specification scope of a data type.

I do think it's in Specification scope to have a well defined field, so it's cross catalog and cross engine, that can be used by a Maintenance operation to guide the correct decision on orphan clean up. I think this should be in the type definition because each entry in a table could be different, meaning in one row the file type could be something maintenance cleans up while the next is a file reference stored in multiple tables.

Separately I don't think it's a safe assumption that a table will mostly or only have files co-located/relative with a table. Especially with S3 Buckets being global.

@Kurtiscwright I think we should make this a separate discussion from the spec definition of the type. This is consistent with all other files that may be shared (manifests, data files, etc. even if not recommended). We don't define who "owns" these artifacts as part of the spec and adding a value to the type makes this more complicated (not less). You still have all of the ownership issues if you add it to the type, but now you have an additional field that can be out of sync (ownership transfer, replication, etc. can all result in inconsistent semantics).

We're also not making assumptions about co-location/relative files, but rather, defining the representations and requirements for absolute and relative pathing. I think there will be use cases where all references are external (e.g. to a media catalog) and there will be cases where they will all be relative (e.g. ingest pipelines), so we want well defined expectations without breaking other gauarantees.

@danielcweeks
danielcweeks merged commit 59ccccb into apache:main Oct 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.