0
嗨我是一个基本的学习者在hadoop蜂巢$ HOME/.hivehistory不工作或让我知道在哪里键入该命令。我由于某些原因关闭了我的终端,并在一段时间后打开。现在我怎么能打开以前的命令history.Please帮我,我无法理清。蜂巢历史comman不工作
嗨我是一个基本的学习者在hadoop蜂巢$ HOME/.hivehistory不工作或让我知道在哪里键入该命令。我由于某些原因关闭了我的终端,并在一段时间后打开。现在我怎么能打开以前的命令history.Please帮我,我无法理清。蜂巢历史comman不工作
.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());
}