Skip to content

parquet: introduce FILE logical type - #10109

Merged
Jefffrey merged 8 commits into
apache:mainfrom
brkyvz:fileType
Aug 31, 2026
Merged

Jefffrey merged 8 commits into
apache:mainfrom
brkyvz:fileType

Conversation

@brkyvz

@brkyvz brkyvz commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Introduces the reference implementation for the new LogicalTypeAnnotation File as discussed in this design document

What changes are included in this PR?

Introduces a new LogicalTypeAnnotation called FILE. It enforces that a group with this type annotation have the following fields by name:

uri 		 		STRING	
offset				INT64      
size	 	 		INT64	
content_type		 STRING
checksum		 	STRING
inline 		 		BINARY

Are these changes tested?

Yes, unit tested

Are there any user-facing changes?

Introduces a new LogicalTypeAnnotation called FILE

@github-actions github-actions Bot added the parquet parquet crate label Jun 10, 2026
@etseidl etseidl added the api-change Breaking API change, needs to wait for a major version release label Jun 10, 2026

@etseidl etseidl left a comment

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.

Looks good, just one test nit.

I marked this as a breaking change since it adds a variant to a public enum.

Comment thread parquet/src/schema/types.rs Outdated
assert!(result
.unwrap_err()
.to_string()
.contains("unrecognized field"));

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.

Nit: in general I prefer full string compares to contains. In this case it should at least test for the specific unrecognized field name 'unknown_field'.

@etseidl

etseidl commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Looking very nice. Could you also add a roundtrip test to/from parquet? 🙏

Also, do you have any plans to add a FILE containing file to parquet-testing?

@Jefffrey

Copy link
Copy Markdown
Contributor

are we keen on getting this in for release 60.0.0?

@etseidl

etseidl commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

are we keen on getting this in for release 60.0.0?

Now that the spec change has happened, I think so. @brkyvz do you have time to work on this?

@brkyvz

brkyvz commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

@etseidl yes, will update hopefully today or tomorrow

brkyvz and others added 2 commits August 27, 2026 20:28
The FILE logical type no longer supports self-references (a byte range
within the current file addressed by offset/size with no uri). A uri is
always resolved as an external reference, and offset/size apply only to
data referenced by uri. Update the LogicalType::File doc comment to match
the revised spec wording.

Co-authored-by: Isaac <[email protected]>
@etseidl

etseidl commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

I took the liberty of creating an issue and linking this to it.

@brkyvz

brkyvz commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Thank you so much @etseidl !

@etseidl etseidl left a comment

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.

Thanks @brkyvz, I think this is a good start. I'd like to validate this against an example parquet file, but that can be done as a follow up. I think the important thing is to get the LogicalType enum updated for inclusion in 60.0.0.

@Jefffrey Jefffrey changed the title Introduce FileType reference implementation parquet: introduce FILE logical type Aug 31, 2026
@Jefffrey
Jefffrey merged commit 8a6ce46 into apache:main Aug 31, 2026
31 checks passed
@Jefffrey

Copy link
Copy Markdown
Contributor

thanks @brkyvz & @etseidl

Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 2, 2026
# Which issue does this PR close?

- Closes apache#10900.

# Rationale for this change

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

Introduces the reference implementation for the new
LogicalTypeAnnotation File as discussed in this [design
document](https://docs.google.com/document/d/1AiwrstqkwkBoOZqgOkm9JGwSMcNeHyLR7EEj1CVqpZQ/edit?tab=t.0#heading=h.k8qyue4jj4rn)

# What changes are included in this PR?

<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
Introduces a new LogicalTypeAnnotation called FILE. It enforces that a
group with this type annotation have the following fields by name:
```
uri 		 		STRING	
offset				INT64      
size	 	 		INT64	
content_type		 STRING
checksum		 	STRING
inline 		 		BINARY
```

# Are these changes tested?

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->

Yes, unit tested

# Are there any user-facing changes?

<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->


Introduces a new LogicalTypeAnnotation called FILE

---------

Co-authored-by: Isaac <[email protected]>
Co-authored-by: Jefffrey <[email protected]>
Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 18, 2026
# Which issue does this PR close?

- Closes apache#10900.

# Rationale for this change

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

Introduces the reference implementation for the new
LogicalTypeAnnotation File as discussed in this [design
document](https://docs.google.com/document/d/1AiwrstqkwkBoOZqgOkm9JGwSMcNeHyLR7EEj1CVqpZQ/edit?tab=t.0#heading=h.k8qyue4jj4rn)

# What changes are included in this PR?

<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
Introduces a new LogicalTypeAnnotation called FILE. It enforces that a
group with this type annotation have the following fields by name:
```
uri 		 		STRING	
offset				INT64      
size	 	 		INT64	
content_type		 STRING
checksum		 	STRING
inline 		 		BINARY
```

# Are these changes tested?

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->

Yes, unit tested

# Are there any user-facing changes?

<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->


Introduces a new LogicalTypeAnnotation called FILE

---------

Co-authored-by: Isaac <[email protected]>
Co-authored-by: Jefffrey <[email protected]>
Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 21, 2026
# Which issue does this PR close?

- Closes apache#10900.

# Rationale for this change

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

Introduces the reference implementation for the new
LogicalTypeAnnotation File as discussed in this [design
document](https://docs.google.com/document/d/1AiwrstqkwkBoOZqgOkm9JGwSMcNeHyLR7EEj1CVqpZQ/edit?tab=t.0#heading=h.k8qyue4jj4rn)

# What changes are included in this PR?

<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
Introduces a new LogicalTypeAnnotation called FILE. It enforces that a
group with this type annotation have the following fields by name:
```
uri 		 		STRING	
offset				INT64      
size	 	 		INT64	
content_type		 STRING
checksum		 	STRING
inline 		 		BINARY
```

# Are these changes tested?

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->

Yes, unit tested

# Are there any user-facing changes?

<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->


Introduces a new LogicalTypeAnnotation called FILE

---------

Co-authored-by: Isaac <[email protected]>
Co-authored-by: Jefffrey <[email protected]>
Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 25, 2026
# Which issue does this PR close?

- Closes apache#10900.

# Rationale for this change

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

Introduces the reference implementation for the new
LogicalTypeAnnotation File as discussed in this [design
document](https://docs.google.com/document/d/1AiwrstqkwkBoOZqgOkm9JGwSMcNeHyLR7EEj1CVqpZQ/edit?tab=t.0#heading=h.k8qyue4jj4rn)

# What changes are included in this PR?

<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
Introduces a new LogicalTypeAnnotation called FILE. It enforces that a
group with this type annotation have the following fields by name:
```
uri 		 		STRING	
offset				INT64      
size	 	 		INT64	
content_type		 STRING
checksum		 	STRING
inline 		 		BINARY
```

# Are these changes tested?

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->

Yes, unit tested

# Are there any user-facing changes?

<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->


Introduces a new LogicalTypeAnnotation called FILE

---------

Co-authored-by: Isaac <[email protected]>
Co-authored-by: Jefffrey <[email protected]>
etseidl pushed a commit to etseidl/arrow-rs that referenced this pull request Nov 4, 2026
…n type (apache#11877)

# Which issue does this PR close?

- Closes apache#11876.

# Rationale for this change

apache#10109 added the Parquet `FILE` logical type, but not its Arrow mapping.
A `FILE` group reads as a plain struct, and `ArrowWriter` cannot write
the annotation, so Arrow-based writers cannot produce conforming `FILE`
columns.

# What changes are included in this PR?

Following the Variant precedent:
- A new `parquet::arrow::file_type::FileType` extension type, named
`arrow.parquet.file`, with no metadata. Its storage is a struct whose
fields are any subset of `uri`, `offset`, `size`, `content_type`,
`checksum`, `inline`, each nullable, matching the Parquet-side
validation from apache#10109 (string fields accept
`Utf8`/`LargeUtf8`/`Utf8View`, `inline` accepts any binary type).
- Read: `try_add_extension_type` / `has_extension_type` tag a `FILE`
group with `FileType`.
- Write: `logical_type_for_struct` returns `LogicalType::File` for a
struct field with `FileType`; its gating now covers either
`variant_experimental` or `file_experimental`. Sub-field ids come from
the existing `PARQUET:field_id` metadata.
- A `file_experimental` feature (also part of `experimental`),
documented in the README and crate docs, and a CI compile check with
`--no-default-features --features file_experimental`.

# Are these changes tested?

Yes, in `parquet/src/arrow/file_type.rs`: accepted and rejected struct
shapes, an Arrow to Parquet to Arrow schema round trip (annotation and
field ids), a struct without the extension staying unannotated, and
`ArrowWriter` write and read round trips at the top level and as a list
element.

Locally: `cargo test -p parquet --all-features --lib` passes, `cargo
clippy -p parquet --all-targets --all-features -- -D warnings` is clean,
docs build with `-D warnings`, and `cargo check -p parquet` passes with
default features, `variant_experimental` only, and `file_experimental`
only.

# Are there any user-facing changes?

A new, experimental, opt-in `file_experimental` feature and `FileType`
extension type. No change without the feature.

The code, tests, and this description were drafted with an AI assistant
and reviewed by me before submitting.

This pull request and its description were written by Isaac.

---------

Signed-off-by: Dejan Krakovic <[email protected]>
Co-authored-by: dejankrak-db <[email protected]>
Co-authored-by: Isaac <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change Breaking API change, needs to wait for a major version release next-major-release the PR has API changes and it waiting on the next major version parquet parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parquet: Add support for new FILE logical type

3 participants