Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC07E104F4 for ; Thu, 22 Jan 2015 19:16:40 +0000 (UTC) Received: (qmail 6622 invoked by uid 500); 22 Jan 2015 19:16:37 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 6548 invoked by uid 500); 22 Jan 2015 19:16:37 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 6460 invoked by uid 500); 22 Jan 2015 19:16:37 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 6450 invoked by uid 99); 22 Jan 2015 19:16:37 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jan 2015 19:16:37 +0000 Date: Thu, 22 Jan 2015 19:16:37 +0000 (UTC) From: "Prasanth Jayachandran (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14288028#comment-14288028 ] Prasanth Jayachandran commented on HIVE-9310: --------------------------------------------- [~gopalv] Yes. The history dir is the user's home directory which exists. The history file .hivehistory also exists (will be created if it doesn't exist). But still the commands are not logged to the hive history file. To reproduce 1) Remove the .hivehistory file 2) Restart hive cli 3) Run some commands and quit cli 4) When we rerun the hive cli again, press up arrow nothing will show up from history. I suspect, the flushing doesn't happen because of quit command which issues System.exit(0) and quits the cli without ever calling the history.flush(). Same happens with SIGINT as well. I think we need to flush the history before processing every command. Adding the history flushing just before executing the command seems to fix the issue. I can put up a patch for it if you can confirm that the current way of flushing does not work. > CLI JLine does not flush history back to ~/.hivehistory > ------------------------------------------------------- > > Key: HIVE-9310 > URL: https://issues.apache.org/jira/browse/HIVE-9310 > Project: Hive > Issue Type: Bug > Components: CLI > Affects Versions: 0.15.0 > Reporter: Gopal V > Assignee: Gopal V > Priority: Minor > Fix For: 0.15.0 > > Attachments: HIVE-9310.1.patch > > > Hive CLI does not seem to be saving history anymore. > In JLine with the PersistentHistory class, to keep history across sessions, you need to do {{reader.getHistory().flush()}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)