Skip to content

GH-3708: Inline parquet.thrift - #3709

Open
divjotarora wants to merge 1 commit into
apache:masterfrom
divjotarora:inline-thrift
Open

GH-3708: Inline parquet.thrift#3709
divjotarora wants to merge 1 commit into
apache:masterfrom
divjotarora:inline-thrift

Conversation

@divjotarora

@divjotarora divjotarora commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

It is currently not possible to build working POCs for unreleased parquet-format changes in parquet-java because the parquet-format dependency must be updated using a released version. This blocks reference implementations from merging and will become a bigger issue if the current versioning proposal goes through and we start having more "preview" features where writes are expected to support unreleased spec changes behind feature flags.

What changes are included in this PR?

This PR removes the dependency on github.com/apache/parquet-format and instead adds an inlined copy of parquet.thrift (parquet-format-structures/src/main/thrift/parquet.thrift) as well as a "sidecar" metadata file (parquet-format-structures/src/main/thrift/parquet-format.version) to indicate the parquet-format version that's being inlined. This can be either an X.Y.Z semantic version or a commit hash.

There are two scripts added to help manage the vendored copy:

  1. dev/update-parquet-thrift.sh [$SHA | --version X.Y.Z updates the inlined parquet.thrift to match an upstream copy of parquet-format given either a commit hash (for POC development) or a version (for releases)
  2. dev/check-parquet-thrift-release.sh checks that inlined parquet.thrift mirrors a parquet-format release, not an unreleased commit. This is meant to be used in parquet-java releases only, not to block features from merging.

Are these changes tested?

Edit inlined parquet.thrift with a meaningless change and then validate it gets overwritten:

-- Validate diff
> git diff
--- a/parquet-format-structures/src/main/thrift/parquet.thrift
+++ b/parquet-format-structures/src/main/thrift/parquet.thrift
...

-- check-parquet-thrift-release should fail due to diff
> ./dev/check-parquet-thrift-release.sh
ERROR: inlined parquet.thrift differs from parquet-format 2.13.0.

-- Force an update
> ./dev/update-parquet-thrift.sh --version 2.13.0
Update complete:
  version:    2.13.0 (release sync)

-- check-parquet-thrift-release should now succeed 
> ./dev/check-parquet-thrift-release.sh
OK: inlined parquet.thrift matches parquet-format 2.13.0.

Also test updating to a commit rather than a version:

> ./dev/update-parquet-thrift.sh 2076361bb64e2de9ca6a8d06eda025a6fa4e9df6
Update complete:
  old commit: c47e2a66e88943fc46fde1b028a9432f14fdf5c0
  new commit: 2076361bb64e2de9ca6a8d06eda025a6fa4e9df6
  version:    UNRELEASED (POC sync — run --version <ver> for a release sync)

-- Validate it changed
> git diff --stat
parquet-format-structures/src/main/thrift/parquet-format.version |  4 ++--
parquet-format-structures/src/main/thrift/parquet.thrift         | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++--------

-- check-parquet-thrift-release should fail due to unreleased version
> ./dev/check-parquet-thrift-release.sh
ERROR: inlined parquet.thrift is not from a released parquet-format version.

Are there any user-facing changes?

No

Closes #3708

@divjotarora
divjotarora force-pushed the inline-thrift branch 2 times, most recently from 12d885d to dc2c7b9 Compare August 5, 2026 20:27
@divjotarora
divjotarora marked this pull request as ready for review August 5, 2026 21:00
Comment thread dev/prepare-release.sh
tag="apache-parquet-$release_version-rc$2"

# Ensure the inlined parquet.thrift matches an official parquet-format release.
"$(dirname "$0")/check-parquet-thrift-release.sh"

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.

I think this is an unnecessary requirement. This assumes that we can only release Parquet Java if there has also been a release of Parquet Format, which is beyond the scope of what we are trying to do here.

The primary purpose of this change is to use a local copy of parquet.thrift. A secondary concern is helping us to update that file easily and know when it has changed. I think we should remove changes to the release script unless we decide to make this a requirement.

# under the License.

# Verifies that the parquet-format.version sidecar file is tracking a released parquet-format
# version and that the inlined parquet.thrift byte-matches the upstream file at that version.

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.

I think that this should be removed, or at least changed to check against the parquet-format.version file and nothing else. We do need to be able to check the state of the thrift file, but that has little to do with releases. Plus, the file is version controlled, so we should be able to easily tell when it was modified and where the content came from by looking at parquet-format.version.

commit_arg=""
version_arg=""

if [[ "$1" == "--version" ]]; then

@rdblue rdblue Aug 28, 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.

Can't we just use a ref? If it is a tag then we get that version, otherwise we get the commit hash? That seems simpler than implementing CLI parsing and validation here.

echo " -> commit: $resolved_sha"
else
resolved_sha="$commit_arg"
resolved_version="UNRELEASED"

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.

This isn't necessarily true. I think we should omit the resolved version instead of saying the content is not released. This could be a commit hash referring to a commit that is in a released version.

Comment thread dev/parquet-thrift-lib.sh
echo "ERROR: failed to fetch ${url} after ${attempt} attempts" >&2
return 1
fi
sleep $((attempt * 2))

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.

Seems overcomplicated to have retry logic unless we actually need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline parquet.thrift instead of dynamically pulling in parquet-format

2 participants