Skip to content

[FLINK-36594][hive]HiveCatalog should set HiveConf.hiveSiteLocation back#32

Open
slankka wants to merge 2 commits into
apache:mainfrom
slankka:FLINK-36594
Open

[FLINK-36594][hive]HiveCatalog should set HiveConf.hiveSiteLocation back#32
slankka wants to merge 2 commits into
apache:mainfrom
slankka:FLINK-36594

Conversation

@slankka
Copy link
Copy Markdown
Contributor

@slankka slankka commented Feb 20, 2025

What is the purpose of the change

Using HiveCatalog will cause another hive program lost the hive-site.xml from HiveConf

This change will set HiveConf.hiveSiteLocation back.

This will reduce the complexity caused by the loading order of static configuration files in HiveConf that other big data components depend on.

Brief change log

Visit JIRA ticket to for details.

Originally created from flink repo: apache/flink#25568

@jlalwani-amazon
Copy link
Copy Markdown

jlalwani-amazon commented Apr 27, 2026

Thanks for this fix. the root cause analysis is solid. Setting HiveConf.hiveSiteLocation to null in a static context affects all subsequent HiveConf instances in the JVM, which breaks other Hive-dependent libraries (Hudi, Iceberg, etc.).

One thing I noticed: the same code block also modifies two other static fields that aren't being restored:

HiveConf.setHiveSiteLocation(null);      // line 258 — your PR restores this ✅
HiveConf.setLoadMetastoreConfig(false);  // line 259 — not restored ❌
HiveConf.setLoadHiveServer2Config(false); // line 260 — not restored ❌

These have the same problem. they're static fields that affect all subsequent HiveConf instances in the JVM. If another library expects metastore or HiveServer2 config to be loaded from default locations, setting these to false without restoring them could cause similar issues.

Should we save and restore all three for a complete fix?

@slankka
Copy link
Copy Markdown
Contributor Author

slankka commented May 12, 2026

@jlalwani-amazon agreed and changed

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