slankka created FLINK-36594:
-------------------------------
Summary: HiveCatalog should set HiveConf.hiveSiteLocation back
Key: FLINK-36594
URL: https://issues.apache.org/jira/browse/FLINK-36594
Project: Flink
Issue Type: Bug
Components: Connectors / Hive
Affects Versions: 1.19.1, 1.20.0, 1.17.2, 1.17.1
Reporter: slankka
when using HiveCatalog, HiveCatalog changes HiveConf.hiveSiteLocation to null,
HiveCatalog can load hive-site.xml itself without this variable , but the rest
code after that, still assuming HiveConf 'searches' hive-site.xml from
classpath.
I mean, HiveCatalog turn it off, then any instance of HiveConf will never load
hive-site.xml which user put it on classpath, yarn provided, such as hudi, only
if you addResource explicitly, or Hive search it from user uber jar which need
another effort.
Example
{code:java}
//at first
HiveConf static initialization code try to search hive-site.xml, and only once.
static {
hiveSiteURL = findConfigFile(classLoader, "hive-site.xml", true);
}{code}
{code:java}
String name = "myhive";
String defaultDatabase = "mydatabase";
String hiveConfDir = "/opt/hive-conf";
HiveCatalog hive = new HiveCatalog(name, defaultDatabase, hiveConfDir);
tableEnv.registerCatalog("myhive", hive);
// set the HiveCatalog as the current catalog of the session
tableEnv.useCatalog("myhive"); {code}
after running code above:
{code:java}
//Another framework who are using hive
HiveConf hiveConf = new HiveConf(hadoopConf, HiveConf.class); {code}
The hiveConf DOES NOT load hive-site.xml from classpath, which will cause
configuration loading failure.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)