Hive storages DB information in ThreadLocal, and quartz uses the SimpleThreadPool. If HQL accesses the different Hive DB, which may lead to the exception "table db.xx not found".
Relevant code:
Hive Version: Hive 0.9
Clas Name:org.apache.hadoop.hive.ql.metadata.Hive
private static ThreadLocal hiveDB = new ThreadLocal() {
@OverRide
protected synchronized Object initialValue() {
return null;
}
@Override
public synchronized void remove() {
if (this.get() != null) {
((Hive) this.get()).close();
}
super.remove();
}
};