[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-22 Thread Gopal V (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14287088#comment-14287088
 ] 

Gopal V commented on HIVE-9310:
---

Do you know if the history dir exists? The condition for history seems to be - 
if ((new File(historyDirectory)).exists()) {

 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-22 Thread Prasanth Jayachandran (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-22 Thread Prasanth Jayachandran (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14288043#comment-14288043
 ] 

Prasanth Jayachandran commented on HIVE-9310:
-

Or we have to flush the history before closing the session (finally block after 
execute cli driver).

 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-22 Thread Prasanth Jayachandran (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14288128#comment-14288128
 ] 

Prasanth Jayachandran commented on HIVE-9310:
-

Ctrl + D sends EOF to input in which case history gets flushed properly.
Ctrl + C sends SIGINT which does not flush history. Similarly quit/exit 
commands does not flush.

 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-22 Thread Gopal V (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14288090#comment-14288090
 ] 

Gopal V commented on HIVE-9310:
---

Ah, I exit from the loop from the CLI using a Ctrl+D  that actually saves 
history with the patch.

Let me try with a quit;

 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-21 Thread Prasanth Jayachandran (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14286424#comment-14286424
 ] 

Prasanth Jayachandran commented on HIVE-9310:
-

[~gopalv] The flushing of the history does not seem to work. history.flush() is 
not getting called. Can we flush the history before processing each command? or 
in some other place which is reliable. 

 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-13 Thread Gopal V (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14275231#comment-14275231
 ] 

Gopal V commented on HIVE-9310:
---

[~navis]: We can, but I had one case where my home dir hit 100% in a very old 
build.

What happens to NOSPC IOExceptions thrown from a signal handler?

 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
 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-13 Thread Gopal V (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14275285#comment-14275285
 ] 

Gopal V commented on HIVE-9310:
---

The test failures look unrelated - the error was a YARN exception setting up a 
minicluster, due to a missing dir.

 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
 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-13 Thread Gopal V (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14275282#comment-14275282
 ] 

Gopal V commented on HIVE-9310:
---

Actually, I tried to flush in the signal handler + try/catch ignore and 
annoyingly it looks like it stills needs some thread synchronization.

The sighandler runs as a different thread and flushes the history from a 
different thread while interrupting the main thread. The threading looks rather 
odd, but I'm guessing the processLine() is called from Oozie directly as well 
(unlike the CLI loop).

I'm committing this as-is as I'm tired of losing all CLI history in my test 
runs - need at least parity to 0.14 levels before I introduce new bugs/features.

 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
 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-11 Thread Navis (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14273145#comment-14273145
 ] 

Navis commented on HIVE-9310:
-

Ok, I got it. But still can we flush history in signal 
handler(https://github.com/apache/hive/blob/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java#L325)?

 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
 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-09 Thread Hive QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14270726#comment-14270726
 ] 

Hive QA commented on HIVE-9310:
---



{color:red}Overall{color}: -1 at least one tests failed

Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12690748/HIVE-9310.1.patch

{color:red}ERROR:{color} -1 due to 1 failed/errored test(s), 6737 tests executed
*Failed tests:*
{noformat}
org.apache.hive.hcatalog.hbase.TestPigHBaseStorageHandler.org.apache.hive.hcatalog.hbase.TestPigHBaseStorageHandler
{noformat}

Test results: 
http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/2300/testReport
Console output: 
http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/2300/console
Test logs: 
http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-2300/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests exited with: TestsFailedException: 1 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12690748 - PreCommit-HIVE-TRUNK-Build

 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
 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-09 Thread Gopal V (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14270780#comment-14270780
 ] 

Gopal V commented on HIVE-9310:
---

[~navis]: did not want to leak the implementation out of the same class.

I saw issues with ShutdownHooks and different classloaders in some other work, 
didn't want to go that way because there's no easy way to test these things for 
slow leaks.

My patch is a 5-min safe fix.

 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
 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-08 Thread Navis (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14270515#comment-14270515
 ] 

Navis commented on HIVE-9310:
-

Should it be called in shutdown hook or at least in signal handler either?

 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
 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)


[jira] [Commented] (HIVE-9310) CLI JLine does not flush history back to ~/.hivehistory

2015-01-08 Thread Prasanth Jayachandran (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14269008#comment-14269008
 ] 

Prasanth Jayachandran commented on HIVE-9310:
-

LGTM, +1

 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
 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)