Skip to content

PHOENIX-7953 Add addPhoenixDependencyJars utility for MapReduce jobs#2564

Open
ujjawal4046 wants to merge 3 commits into
apache:masterfrom
ujjawal4046:PHOENIX-7953
Open

PHOENIX-7953 Add addPhoenixDependencyJars utility for MapReduce jobs#2564
ujjawal4046 wants to merge 3 commits into
apache:masterfrom
ujjawal4046:PHOENIX-7953

Conversation

@ujjawal4046

Copy link
Copy Markdown
Contributor

Summary

  • Add PhoenixMapReduceUtil.addPhoenixDependencyJars(Configuration) that registers Phoenix and its transitive dependency jars with the YARN distributed cache (tmpjars), analogous to HBase's addHBaseDependencyJars.
  • Without this, MR jobs using Phoenix fail with NoClassDefFoundError on YARN containers for jars like json-path, bson, phoenix-hbase-compat, commons-csv, etc.
  • Update all Phoenix MR tools (UpdateStatisticsTool, IndexTool, IndexScrutinyTool, PhoenixSyncTableTool, TransformTool, MultiHfileOutputFormat) to call the new method.

Motivation

After upgrading to Phoenix 5.3, several new transitive dependencies (json-path, bson, phoenix-hbase-compat as a separate jar) are required at runtime but were not being shipped to YARN containers. Each Phoenix MR tool was independently maintaining an incomplete list of classes to ship. This centralizes the logic so downstream consumers and Phoenix's own tools stay in sync.

JIRA: https://issues.apache.org/jira/browse/PHOENIX-7953

Test plan

  • New unit test PhoenixMapReduceUtilTest verifies all expected jars appear in tmpjars
  • Run UpdateStatisticsTool on a cluster and verify no NoClassDefFoundError
  • Run IndexTool on a cluster and verify no NoClassDefFoundError

Note

This code was AI-assisted using Claude (Anthropic).

@virajjasani virajjasani self-requested a review July 1, 2026 15:58
@virajjasani

Copy link
Copy Markdown
Contributor

Ujjawal Kumar added 3 commits July 3, 2026 11:15
Add PhoenixMapReduceUtil.addPhoenixDependencyJars(Configuration) that
registers Phoenix and its transitive dependency jars with the YARN
distributed cache (tmpjars), analogous to HBase addHBaseDependencyJars.

Without this, MR jobs that use Phoenix fail with NoClassDefFoundError on
YARN containers for jars like json-path, bson, phoenix-hbase-compat,
commons-csv, etc. that are on the client classpath but not shipped to
the container.

Update all Phoenix MR tools (UpdateStatisticsTool, IndexTool,
IndexScrutinyTool, PhoenixSyncTableTool, TransformTool,
MultiHfileOutputFormat) to call the new method.

AI-assisted: Claude
…ix-core-server

Add explicit compile-scope dependency entries for disruptor, json-path,
and bson which are used directly in PhoenixMapReduceUtil but were only
available transitively via phoenix-core-client.

AI-assisted: Claude
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.

2 participants