Skip to content

Hive query may be disturbed by other concurrent queries #16

@xielong

Description

@xielong

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();
}

};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions