Skip to content

Hive: add HiveCatalog(Configuration, Map<String, String>) convenience constructor#16135

Open
1fanwang wants to merge 1 commit intoapache:mainfrom
1fanwang:iceberg-16134-hivecatalog-conf-properties-ctor
Open

Hive: add HiveCatalog(Configuration, Map<String, String>) convenience constructor#16135
1fanwang wants to merge 1 commit intoapache:mainfrom
1fanwang:iceberg-16134-hivecatalog-conf-properties-ctor

Conversation

@1fanwang
Copy link
Copy Markdown

Closes #16134.

HiveCatalog.initialize(name, properties) reads URI/warehouse from the property map and HMS/Hadoop settings from the Configuration. Callers that have both populated currently need the two-step setConf(conf); initialize(name, properties) dance.

This adds a convenience constructor mirroring HadoopCatalog(Configuration, String), accepting a property map since HiveCatalog reads more than one key:

public HiveCatalog(Configuration conf, Map<String, String> properties) {
  setConf(conf);
  initialize("hive", properties);
}

testConstructorWithConfAndProperties in TestHiveCatalog covers the property-to-conf propagation and verifies caller-provided Configuration entries are preserved.

Surfaced in apache/hive#6454.

*/
public HiveCatalog(Configuration conf, Map<String, String> properties) {
setConf(conf);
initialize("hive", properties);
Copy link
Copy Markdown
Member

@deniskuzZ deniskuzZ Apr 28, 2026

Choose a reason for hiding this comment

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

since we provide a constructor now, should we change setConf and initialize to private and avoid confusion with those APIs?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hive: add HiveCatalog(Configuration, Map<String, String>) convenience constructor

2 participants