Skip to content

HIVE-29768: Fix ClassNotFoundException(SQLStdHiveAuthorizerFactoryForTest) in compactor tests - #6643

Open
maheshrajus wants to merge 2 commits into
apache:masterfrom
maheshrajus:HIVE-29768
Open

HIVE-29768: Fix ClassNotFoundException(SQLStdHiveAuthorizerFactoryForTest) in compactor tests#6643
maheshrajus wants to merge 2 commits into
apache:masterfrom
maheshrajus:HIVE-29768

Conversation

@maheshrajus

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Disables hive.compactor.gather.stats by default in the compactor test base class (CompactorTest)
so post-compaction stats gathering no longer runs during unit tests.
These tests do not assert on the stats that StatsUpdater.gatherStats produces.

Why are the changes needed?

Every TestWorker run (and every other test extending CompactorTest) emits a loud stack trace(CNFE) after each successful compaction.

  ERROR session.SessionState: Error setting up authorization:                                       
    java.lang.ClassNotFoundException:                                                                                                                                                 
  org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactoryForTest 

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existed UT

@maheshrajus

Copy link
Copy Markdown
Contributor Author

@abstractdog @ayushtkn @deniskuzZ @zabetak Could you please review and approve the changes at your convenience?
Thank you!

@uros-b

uros-b commented Aug 9, 2026

Copy link
Copy Markdown
Member

LGTM

@abstractdog

Copy link
Copy Markdown
Contributor

@abstractdog @ayushtkn @deniskuzZ @zabetak Could you please review and approve the changes at your convenience? Thank you!

the fix makes sense to me: let's not gather stats if the compactor tests don't rely on them, can make this comment more concise?

   //Post-compaction stats gathering runs an ANALYZE TABLE query through the Driver,
    // which triggers SessionState.setupAuth() and fails here with a ClassNotFoundException:
    // data/conf/hive-site.xml points hive.security.authorization.manager at
    // SQLStdHiveAuthorizerFactoryForTest, but that class lives in itests/util which
    // isn't on the ql test classpath. StatsUpdater swallows the failure so tests still pass.
    // Disable stats by default as these tests do not assert on the stats that StatsUpdater.gatherStats produces.

Later readers are not interested in this detail; they need to know the basic facts like: "Disable stats by default as these tests do not assert on the stats that StatsUpdater.gatherStats produces." you can also add a minor note that, enabling these would need a proper setup of an authorizer

@maheshrajus

Copy link
Copy Markdown
Contributor Author

the fix makes sense to me: let's not gather stats if the compactor tests don't rely on them, can make this comment more concise?

   //Post-compaction stats gathering runs an ANALYZE TABLE query through the Driver,
    // which triggers SessionState.setupAuth() and fails here with a ClassNotFoundException:
    // data/conf/hive-site.xml points hive.security.authorization.manager at
    // SQLStdHiveAuthorizerFactoryForTest, but that class lives in itests/util which
    // isn't on the ql test classpath. StatsUpdater swallows the failure so tests still pass.
    // Disable stats by default as these tests do not assert on the stats that StatsUpdater.gatherStats produces.

Later readers are not interested in this detail; they need to know the basic facts like: "Disable stats by default as these tests do not assert on the stats that StatsUpdater.gatherStats produces." you can also add a minor note that, enabling these would need a proper setup of an authorizer

@abstractdog Fixed

@mdayakar mdayakar 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.

LGTM

@sonarqubecloud

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants