[Protocol RFC] File data type - #7148
Open
dejankrak-db wants to merge 10 commits into
Open
Conversation
Add a protocol RFC for a new `file` data type that stores a reference to a range of bytes located inline, elsewhere in the same data file, or in an external file. Aligned with the Parquet FILE logical type proposed in apache/parquet-format#585. Introduces the `fileType` table feature (Reader v3 / Writer v7), the `file` primitive type name, Parquet physical encoding, per-leaf statistics, and compatibility notes with other Delta features. See delta-io#7147 Co-authored-by: Isaac
dejankrak-db
marked this pull request as ready for review
July 7, 2026 09:39
ilicmarkodb
reviewed
Jul 7, 2026
| Partition Columns | **Supported:** A `file` column is allowed to be a non-partitioned column of a partitioned table. <br/> **Unsupported:** A `file` value is a group and cannot be serialized to a partition-value string, so a `file` column cannot be a partition column. | ||
| Clustered Tables | **Supported:** A `file` column is allowed to be a non-clustering column of a clustered table. <br/> **Unsupported:** A `file` value is a group and is not a comparable data type as a whole, so a `file` column cannot be a clustering column. | ||
| Delta Column Statistics | **Supported:** A `file` column supports the `nullCount` statistic, and `minValues` / `maxValues` on its comparable leaf fields. See [Statistics for File Columns](#statistics-for-file-columns). <br/> **Unsupported:** The `file` column as a whole is not a comparable data type, and the `inline` field does not support `minValues` / `maxValues`. | ||
| Generated Columns | **Supported:** A `file` column is allowed to be used as a source in a generated column expression, as long as the `file` type is not the result type of the generated column expression. <br/> **Unsupported:** The `file` data type is not allowed to be the result type of a generated column expression. |
Contributor
There was a problem hiding this comment.
why wouldn't we have FILE generated columns?
Author
There was a problem hiding this comment.
Fair question — that restriction was carried over from the Variant RFC. I've reframed this as an open question for discussion on the issue.
…-columns question - Expand the self-reference bullet in the intro with how the bytes are located within the same data file, linking to Byte Resolution. - Reframe the generated-column result-type clause as an open question for discussion rather than a hard restriction inherited from the variant RFC. Co-authored-by: Isaac
…on-goals - Add a "Time Travel and Change Data Feed" section clarifying that Delta time- travels and CDFs the reference, not the referenced bytes, which live outside the transaction log and may be overwritten or deleted independently. - Add a "Non-Goals" section scoping out lifecycle/GC of referenced bytes (including any Delta-managed notion and its VACUUM interaction) and access brokering, keeping the type reference-only and aligned with Parquet/Iceberg. Co-authored-by: Isaac
Standardize the representation of a file column's storage mode (MANAGED/EXTERNAL/UNKNOWN) in the __FILE_TYPE_MODE schema-metadata key, a path-keyed map on the nearest ancestor StructField, mirroring the __COLLATIONS representation and DBR's FileType mode (databricks-eng/runtime#213587). This lets the qualifier round-trip through the Delta log without placing it inside the file value (which must round-trip through the fixed Parquet FILE field set). Only the representation is standardized; MANAGED vs EXTERNAL carries no Delta behavior yet, and lifecycle/GC remains a non-goal. Co-authored-by: Isaac
…a-io#585) Align with the latest apache/parquet-format#585: - size must be set whenever offset is set; a self-reference (no path) must set offset, and therefore size. Drop the now-invalid [offset, EOF) and [0, size) self-reference modes and the external [offset, EOF) mode from the resolution table; add explicit invalid rows. - Define "set" (present, non-null, non-empty for strings) and allow sparse group definitions (a group need only define the fields it uses); add an inline-only example group. - Fields matched case-sensitively by name; field IDs "if they exist". - Readers should ignore unknown checksum algorithms. Follows the consistent prose intent of PR delta-io#585; note its resolution table still lists an [offset, EOF) row that contradicts its own validation section (offset requires size) -- to be raised on the Parquet PR. Co-authored-by: Isaac
…@ 90147dc) Align with the latest apache/parquet-format#585 (commit 90147dc): - path is now a URI-reference per RFC 3986 (absolute or relative), not an opaque location string. Resolves the path/uri debate: name stays `path`, semantics become URI. - checksum form changes from <algorithm>:base64(<digest>) to <algorithm>:<digest> with per-algorithm encoding (lowercase hex for MD5/CRC32/CRC32C/SHA-256, opaque for ETAG); add RFC references and an Encoding column. - content_type: MIME per RFC 2046, defaults to application/octet-stream when unset. - offset must not be negative. - Note that implementations are not expected to treat empty strings as null. Co-authored-by: Isaac
…@ 92228a1) Align with the latest apache/parquet-format#585 (commit 92228a1): - Update checksum RFC citations: MD5 -> RFC 1321, CRC32 -> RFC 2083, CRC32C -> RFC 3385 (SHA-256 unchanged at RFC 6234). - Readers may return a null file value for a row whose reference is invalid. Co-authored-by: Isaac
…o#585 @ 4223744) Align with apache/parquet-format#585 (commit 4223744): the FILE locator field was renamed from `path` to `uri`. Rename the field throughout the field table, resolution table, Parquet examples, writer/reader requirements, statistics, and prose. Generic uses of "path" (field path, absolute path) are unchanged, as is the DBR-specific __FILE_TYPE_MODE storage-mode key. Co-authored-by: Isaac
…@ f241be8) Align with apache/parquet-format#585 (commit f241be8): add the modular-encryption restriction -- data files containing self-references must not use Parquet modular encryption, since self-referenced byte ranges are not encryption modules and cannot be encrypted/authenticated independently. Co-authored-by: Isaac
…rged) apache/parquet-format#585 is now merged. The FILE spec content is unchanged from the last sync (commit f241be8), so no semantic updates are needed. Update references to point at the stable LogicalTypes.md#file spec and drop the "proposed" framing now that the type is part of the Parquet format. Co-authored-by: Isaac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Delta project/connector is this regarding?
Description
This adds a protocol RFC for a new
filedata type. Afilevalue stores a reference to a range of bytes that may be located inline in the value, in a self-reference elsewhere within the same data file, or in an external file at a given URI. It targets file-inventory, manifest, and unstructured-data use cases (e.g. images/audio in object storage) that are increasingly common with AI/ML workloads.The type is aligned with the Parquet
FILElogical type (introduced in apache/parquet-format#585, now merged): the field set (uri,offset,size,content_type,checksum,inline), the physical encoding, and the byte-resolution rules match the Parquet spec so a Deltafilecolumn round-trips through Parquet without loss.Design doc: [DESIGN] Introducing a new "File" logical type to Parquet
The RFC introduces:
fileTypetable feature (Reader Version 3 / Writer Version 7, readers and writers);fileprimitive type name in the schema serialization format;FILElogical type, all six optional fields) and byte-resolution rules, including inline, self-reference, and external references;nullCounton the column andminValues/maxValueson the comparable leaf fields (uri,offset,size,content_type,checksum), excludinginline— enabling data skipping on file-inventory tables filtered by URI;__FILE_TYPE_MODE:MANAGED/EXTERNAL/UNKNOWN) recorded in schema metadata, mirroring the__COLLATIONSrepresentation; only the representation is standardized, with lifecycle/GC semantics left as a non-goal;This is a documentation-only change adding
protocol_rfcs/file-type.mdand listing it inprotocol_rfcs/README.md.see #7147