Skip to content

fix(flink): Fix reflection ctor signature for AwsGlueCatalogSyncTool in HiveSyncContext#18697

Merged
danny0405 merged 1 commit intoapache:masterfrom
KiteSoar:fix-glue-sync
May 7, 2026
Merged

fix(flink): Fix reflection ctor signature for AwsGlueCatalogSyncTool in HiveSyncContext#18697
danny0405 merged 1 commit intoapache:masterfrom
KiteSoar:fix-glue-sync

Conversation

@KiteSoar
Copy link
Copy Markdown
Contributor

@KiteSoar KiteSoar commented May 7, 2026

Describe the issue this Pull Request addresses

Closes #18673.

Flink GLUE sync fails at runtime with NoSuchMethodException because
HiveSyncContext#hiveSyncTool() loads AwsGlueCatalogSyncTool via
reflection using a 2-arg signature (Properties, Configuration), while
the actual constructor is now 3-arg
(Properties, Configuration, Option<HoodieTableMetaClient>).

Summary and Changelog

  • Align the reflection call in HiveSyncContext#hiveSyncTool() with the
    current AwsGlueCatalogSyncTool constructor: add Option.class to
    the parameter types and pass Option.<HoodieTableMetaClient>empty().

Impact

No public API or user-facing change.

Risk Level

low

Documentation Update

none

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

@github-actions github-actions Bot added the size:XS PR with lines of changes in <= 10 label May 7, 2026
Copy link
Copy Markdown
Contributor

@hudi-agent hudi-agent left a comment

Choose a reason for hiding this comment

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

🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

Thanks for the fix! This correctly aligns the reflection call in HiveSyncContext#hiveSyncTool() with the current 3-arg AwsGlueCatalogSyncTool constructor (Properties, Configuration, Option<HoodieTableMetaClient>), resolving the runtime NoSuchMethodException for Flink GLUE sync. No issues flagged from this automated pass — a Hudi committer or PMC member can take it from here for a final review.

cc @yihua

new Class<?>[] {Properties.class, org.apache.hadoop.conf.Configuration.class},
props, hiveConf));
new Class<?>[] {Properties.class, org.apache.hadoop.conf.Configuration.class, Option.class},
props, hiveConf, Option.<HoodieTableMetaClient>empty()));
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.

do you think we can write a simple UT of HiveSyncContext to validate the instantiation of the AWS_GLUE_CATALOG_SYNC_TOOL_CLASS ?

Copy link
Copy Markdown
Contributor

@hudi-agent hudi-agent left a comment

Choose a reason for hiding this comment

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

🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

Thanks for the fix! This aligns the reflection-based instantiation of AwsGlueCatalogSyncTool in HiveSyncContext with its current 3-arg constructor and adds two complementary tests — one in hudi-aws validating end-to-end instantiation through the exact reflection signature, and one in hudi-flink pinning the signature via hasConstructor to catch future drift. No correctness issues found. A few style/readability suggestions in the inline comments. Please take a look, and this should be ready for a Hudi committer or PMC member to take it from here. One small simplification opportunity in HiveSyncContext.java — the HoodieTableMetaClient type witness on Option.empty() is unnecessary and brings in an otherwise-unused import.

cc @yihua

new Class<?>[] {Properties.class, org.apache.hadoop.conf.Configuration.class},
props, hiveConf));
new Class<?>[] {Properties.class, org.apache.hadoop.conf.Configuration.class, Option.class},
props, hiveConf, Option.<HoodieTableMetaClient>empty()));
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: the <HoodieTableMetaClient> type witness isn't needed here — ReflectionUtils.loadClass takes Object... args, so Option.empty() works fine and would also let you drop the HoodieTableMetaClient import that was added solely for this.

- AI-generated; verify before applying. React 👍/👎 to flag quality.

@github-actions github-actions Bot added size:S PR with lines of changes in (10, 100] and removed size:XS PR with lines of changes in <= 10 labels May 7, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.89%. Comparing base (91f341f) to head (1cf444d).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...va/org/apache/hudi/sink/utils/HiveSyncContext.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18697      +/-   ##
============================================
- Coverage     68.07%   67.89%   -0.18%     
- Complexity    28943    28957      +14     
============================================
  Files          2519     2521       +2     
  Lines        140664   141040     +376     
  Branches      17428    17480      +52     
============================================
+ Hits          95757    95766       +9     
- Misses        37043    37412     +369     
+ Partials       7864     7862       -2     
Flag Coverage Δ
common-and-other-modules 44.22% <0.00%> (-0.13%) ⬇️
hadoop-mr-java-client 44.95% <ø> (+<0.01%) ⬆️
spark-client-hadoop-common 48.42% <ø> (-0.01%) ⬇️
spark-java-tests 48.64% <ø> (+<0.01%) ⬆️
spark-scala-tests 44.76% <ø> (+<0.01%) ⬆️
utilities 37.69% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...va/org/apache/hudi/sink/utils/HiveSyncContext.java 87.50% <0.00%> (-2.25%) ⬇️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hudi-bot
Copy link
Copy Markdown
Collaborator

hudi-bot commented May 7, 2026

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@danny0405 danny0405 merged commit 63f721d into apache:master May 7, 2026
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S PR with lines of changes in (10, 100]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HiveSync mode GLUE fails with Flink

5 participants