2017-05-06 19 views
0

こんにちは私はハープトップハイブの基本的な学習者です。$ HOME/.hivehistoryは動作していないか、コマンドを入力する場所を教えてください。何らかの理由でターミナルを閉じてしばらくしてから開きました。今、私は以前のコマンド履歴を開くことができます。私を助けてください。私はソートできません。ハイブ履歴コマンドが動作しない

答えて

0

.hivehistoryは、CLIを起動したユーザのホームディレクトリの下にあります。 -

ユーザーhive

bash-4.1$ ls -l ~hive/.hivehistory 
-rw-r--r-- 1 hive hive 20 May 6 10:53 /var/lib/hive/.hivehistory 

ソースコードで呼び出された場合(私は現在使用しているユーザーである)ユーザーcloudera

bash-4.1$ ls -l ~/.hivehistory 
-rw-rw-r-- 1 cloudera cloudera 1093 May 6 10:42 /home/cloudera/.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()); 
    } 
関連する問題