Skip to content

HIVE-29301: Missing histogram in DESCRIBE FORMATTED after prior column DESCRIBE - #6670

Open
cyanzheng2926 wants to merge 2 commits into
apache:masterfrom
cyanzheng2926:HIVE-29301_missing_histogram
Open

HIVE-29301: Missing histogram in DESCRIBE FORMATTED after prior column DESCRIBE#6670
cyanzheng2926 wants to merge 2 commits into
apache:masterfrom
cyanzheng2926:HIVE-29301_missing_histogram

Conversation

@cyanzheng2926

Copy link
Copy Markdown
Contributor

For embedded metastore, session level SET updates HiveConf in place, but embedded ObjectStore can keep a stale Configuration reference after an earlier column stats fetch, leaving describe formatted histogram values empty despite metastore.stats.fetch.kll=true. Rebind the embedded handler and ObjectStore when
stats fetch keys change in embedded mode only. Add order-dependent qfile reproducers verified with TestMiniLlapCliDriver.

What changes were proposed in this pull request?

When metastore.stats.fetch.kll=true is set after an earlier DESCRIBE FORMATTED on a column in the same session, histogram may be shown as empty on a subsequent DESCRIBE FORMATTED even when kll data exists in the metastore.
This PR fixes that for embedded metastore by re-syncing the embedded handler and ObjectStore configuration after session level config set for stats-fetch flags.

Added syncEmbeddedHandlerConf method under IMetaStoreClient (default no-op), delegate through MetaStoreClientWrapper, implemented in ThriftHiveMetaStoreClient to rebind embedded handler/ObjectStore when performing set on stats-fetch keys.

Why are the changes needed?

For embedded metastore, session level set updates session HiveConf in place, but embedded ObjectStore can retain a stale config reference after an earlier column stats fetch, causing inconsistency between display and actual metadata storage.

Does this PR introduce any user-facing change?

Yes. For embedded metastore sessions, set metastore.stats.fetch.kll=true after an earlier column desc formatted statement now correctly populates histogram values on subsequent desc formatted commands.

How was this patch tested?

Added the qtest files using the examples from the jira https://issues.apache.org/jira/browse/HIVE-29301

…ng another DESCRIBE FORMATTED before setting metastore.stats.fetch.kll

For embedded metastore, session level SET updates HiveConf in place, but embedded ObjectStore can keep a
stale Configuration reference after an earlier column stats fetch, leaving
describe formatted histogram values empty despite metastore.stats.fetch.kll=true.
Rebind the embedded handler and ObjectStore when
stats fetch keys change in embedded mode only. Add order-dependent qfile
reproducers verified with TestMiniLlapCliDriver.
@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

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.

2 participants