Skip to content

feat(hive): vendor Hive Metastore IDL and generated bindings - #749

Merged
wgtmac merged 2 commits into
apache:mainfrom
MisterRaindrop:feat/hive-metastore-vendored-bindings
Jun 16, 2026
Merged

feat(hive): vendor Hive Metastore IDL and generated bindings#749
wgtmac merged 2 commits into
apache:mainfrom
MisterRaindrop:feat/hive-metastore-vendored-bindings

Conversation

@MisterRaindrop

@MisterRaindrop MisterRaindrop commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Update vendored Hive Metastore IDL to Hive 4.0.1.
  • Check in generated HMS/fb303 C++ bindings.
  • Add a regeneration script plus lint/license exclusions for generated sources.

Generate the Hive Metastore C++ bindings once from the vendored Thrift
IDL and check them into src/iceberg/catalog/hive/gen-cpp/, so a normal
build needs no Thrift IDL compiler. dev/update_hive_thrift.sh regenerates
them when the IDL changes (mirrors Arrow's build-support/update-thrift.sh).

The vendored IDL is pinned to Hive 4.0.1: Hive 3.1 declares
Table.creationMetadata before CreationMetadata is defined, so Thrift's C++
generator emits an incomplete type that fails under C++23 -Werror; 4.0
reorders the structs.

The generated sources keep Thrift's own @generated header instead of an
ASF license header, and are excluded from license-eye and the formatting
hooks, matching how Apache Arrow vendors its Thrift-generated Parquet code.
@MisterRaindrop MisterRaindrop changed the title build(hive): vendor Hive Metastore IDL and pre-generated bindings feat(hive): vendor Hive Metastore IDL and generated bindings Jun 16, 2026
@MisterRaindrop
MisterRaindrop marked this pull request as ready for review June 16, 2026 02:12
@zhjwpku

zhjwpku commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Do we need to check in the generated code? It might be cleaner to have the build system generate these files on the fly instead, since the IDL is the source of truth and the generated code is just a derived artifact.

@wgtmac

wgtmac commented Jun 16, 2026

Copy link
Copy Markdown
Member

Do we need to check in the generated code? It might be cleaner to have the build system generate these files on the fly instead, since the IDL is the source of truth and the generated code is just a derived artifact.

I don't think so. These files are not changed constantly so it wastes resource and complicates the ci workflow if we built them dynamically. Arrow C++ does the same thing for parquet thrift source code.

@zhjwpku

zhjwpku commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

@MisterRaindrop Just curious, how long does it take to generate these files?

@MisterRaindrop

Copy link
Copy Markdown
Contributor Author

@MisterRaindrop Just curious, how long does it take to generate these files?

The gen cpp speed is very fast, around one second.

@zhjwpku zhjwpku left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@wgtmac

wgtmac commented Jun 16, 2026

Copy link
Copy Markdown
Member

Thanks @MisterRaindrop for adding this and @zhjwpku for the review!

@wgtmac
wgtmac merged commit 40cc992 into apache:main Jun 16, 2026
21 checks passed
@MisterRaindrop
MisterRaindrop deleted the feat/hive-metastore-vendored-bindings branch June 16, 2026 06:57
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.

3 participants