private static String getCurrentDB() {
    String currentDB = null;
    if (SessionState.get() != null) {
      currentDB = SessionState.get().getCurrentDatabase();
    }
    return currentDB == null ? "default" : currentDB;
  }
Set hive input format, and input format file if necessary.
ql/src/java/org/apache/hadoop/hive/ql/exec/mr/ExecDriver.java