嗨,我是Hadoop Hive中的基本学习者。$ home/.hive History不起作用,或者让我知道在哪里输入该命令。我由于某些原因关闭了我的终端,并在此之后打开某个时间。现在如何打开以前的命令历史记录。请帮助我。我无法整理一下。
.hivehistory
位于调用CLI的用户的主目录下方,例如 -
使用用户cloudera
调用(我当前正在使用的用户(
bash-4.1$ ls -l ~/.hivehistory
-rw-rw-r-- 1 cloudera cloudera 1093 May 6 10:42 /home/cloudera/.hivehistory
使用用户hive
bash-4.1$ ls -l ~hive/.hivehistory
-rw-r--r-- 1 hive hive 20 May 6 10:53 /var/lib/hive/.hivehistory
源代码:clidriver.java
private void setupCmdHistory() {
final String HISTORYFILE = ".hivehistory";
String historyDirectory = System.getProperty("user.home");
PersistentHistory history = null;
try {
if ((new File(historyDirectory)).exists()) {
String historyFile = historyDirectory + File.separator + HISTORYFILE;
history = new FileHistory(new File(historyFile));
reader.setHistory(history);
} else {
System.err.println("WARNING: Directory for Hive history file: " + historyDirectory +
" does not exist. History will not be available during this session.");
}
} catch (Exception e) {
System.err.println("WARNING: Encountered an error while trying to initialize Hive's " +
"history file. History will not be available during this session.");
System.err.println(e.getMessage());
}