You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Tianyi Wang (Code Review)" <ge...@cloudera.org> on 2017/08/15 17:37:46 UTC

[Impala-ASF-CR] Impala-992: Rerun past queries from history in shell

Tianyi Wang has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/7674

Change subject: Impala-992: Rerun past queries from history in shell
......................................................................

Impala-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and shortcut "@" to impala-shell.
User can rerun a certain query by its index given by history command.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
command. History index is 1-based. The rerun command itself won't appear
in history.

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
1 file changed, 48 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/2
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#5).

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................

IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and shortcut "@" to impala-shell.
User can rerun a certain query by its index given by history command.
A valid index is an integer in [1, history_length] or
[-history_length, -1]. Negavie values index history in reverse order.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
and "@-1;" reruns the last query. The rerun command itself won't appear
in history. The history index is 1-based and increasing. Old entries
might be truncated when impala-shell starts, and the indexes will be
realigned to 1, so the same index may refer to different commands among
multiple impala-shell instances.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 84 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/5
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Sailesh Mukil (Code Review)" <ge...@cloudera.org>.
Sailesh Mukil has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 9:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/7674/9/shell/impala_shell.py
File shell/impala_shell.py:

PS9, Line 1069: check_readline
IMO, this function doesn't help us much. I'd revert to not having this function.

As for the repeated readline error to print, you can add the message as a string above in L49.

READLINE_UNAVAILABLE_ERROR = "The readline module was either not found or disabled. Command history will not be collected."

and print the string in the necessary places.


PS9, Line 1092: history_length
Rename to 'history_len' for consistency with other functions.


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 9
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 5:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/7674/4/shell/impala_shell.py
File shell/impala_shell.py:

Line 1089:     """Rerun a command with an command index in history
> Unless you're trying to achieve something special, you can just have the st
Thanks. I should have noticed the syntax looking around in this file.


PS4, Line 1164:  original
> nit: characters
Done


PS4, Line 1166: their aliases.
              :     """
> I'd probably leave out this sentence since it'll be hard to keep this in sy
Removed.


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 5:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/7674/5//COMMIT_MSG
Commit Message:

Line 9: This patch adds a new command "rerun" and shortcut "@" to impala-shell.
nit: and a shortcut.


Line 10: User can rerun a certain query by its index given by history command.
nit: users...


PS5, Line 12: Negavie
typo


http://gerrit.cloudera.org:8080/#/c/7674/5/shell/impala_shell.py
File shell/impala_shell.py:

PS5, Line 1105: format
I think this should be aligned with the . under the " according to PEP8.


Line 1111:     # Remove the semicolon at last.
I think this comment now is not needed anymore, the command looks self explanatory enough to me.


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Sailesh Mukil (Code Review)" <ge...@cloudera.org>.
Sailesh Mukil has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 10: Code-Review+2

-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 10
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 9: Code-Review+1

-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 9
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 4:

(12 comments)

http://gerrit.cloudera.org:8080/#/c/7674/2//COMMIT_MSG
Commit Message:

PS2, Line 7: IMPALA
> nit: capitalize
Done


PS2, Line 9: @
> What's the reason for picking "@" over "!"? The latter is used in shells an
Currently "!" is used to run shell commands in impala-shell.


PS2, Line 12: _length, -1]. Negavie val
> Can you give a usage example? Does the history count backwards or forwards 
More example and explanation is given.


http://gerrit.cloudera.org:8080/#/c/7674/2/shell/impala_shell.py
File shell/impala_shell.py:

PS2, Line 79: object
> Why is this needed?
The direct reason is that "super" in line 1164 cannot be used with an old style class. And old style class is not recommended after python 2.1.
https://stackoverflow.com/questions/13816849/old-style-and-new-style-classes-in-python-2-7


Line 1073:     print_to_stderr("The readline module was either not found or disabled. Command "
> nit: You can remove the else and unindent the block, just like you do in th
Done


PS2, Line 1080: one' a
> Not your change, but:
Done


PS2, Line 1090: 
> Format on two lines to make it easier to read.
Done


PS2, Line 1102:     if not (0 < cmd_idx <= history_length or -history_length <= cmd_idx < 0):
> Please use explicit indexing or kwarg-style format: "{}".format(str) is not
Done


PS2, Line 1102:     if not (0 < cmd_idx <= history_length or -history_length <= cmd_idx < 0):
> long line
Done


Line 1107:       cmd_idx += history_length + 1
> Does it always have a semicolon? .rstrip(";") might be more robust and clea
Done


Line 1156:         # The history file is not writable, disable readline.
> Can you mention that this method will perform transformations?
Done


PS2, Line 1157: 
> what will 'line' contain?
One more line of comment is added.


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#5).

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................

IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and shortcut "@" to impala-shell.
User can rerun a certain query by its index given by history command.
A valid index is an integer in [1, history_length] or
[-history_length, -1]. Negavie values index history in reverse order.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
and "@-1;" reruns the last query. The rerun command itself won't appear
in history. The history index is 1-based and increasing. Old entries
might be truncated when impala-shell starts, and the indexes will be
realigned to 1, so the same index may refer to different commands among
multiple impala-shell instances.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 84 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/5
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#4).

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................

IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and shortcut "@" to impala-shell.
User can rerun a certain query by its index given by history command.
A valid index is an integer in [1, history_length] or
[-history_length, -1]. Negavie values index history in reverse order.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
and "@-1;" reruns the last query. The rerun command itself won't appear
in history. The history index is 1-based and increasing. Old entries
might be truncated when impala-shell starts, and the indexes will be
realigned to 1, so the same index may refer to different commands among
multiple impala-shell instances.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 85 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/4
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#3).

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................

IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and shortcut "@" to impala-shell.
User can rerun a certain query by its index given by history command.
Negavie values index history in reverse order. For example, "@1;" or
"rerun 1;" reruns the first query shown in history and "@-1;" reruns
the last query. The rerun command itself won't appear in history.
The history index is 1-based increasing and the old entries might be
truncated when impala-shell starts, so the same index may not refer the
same command.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 85 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/3
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>

[Impala-ASF-CR] Impala-992: Rerun past queries from history in shell

Posted by "Sailesh Mukil (Code Review)" <ge...@cloudera.org>.
Sailesh Mukil has posted comments on this change.

Change subject: Impala-992: Rerun past queries from history in shell
......................................................................


Patch Set 2:

(3 comments)

Could you add some tests for this too?

Have a look at $IMPALA_HOME/tests/shell/ for previous examples.

http://gerrit.cloudera.org:8080/#/c/7674/2//COMMIT_MSG
Commit Message:

PS2, Line 7: Impala
All caps.


http://gerrit.cloudera.org:8080/#/c/7674/2/shell/impala_shell.py
File shell/impala_shell.py:

PS2, Line 1080: exists
Not your change, but:

nit: exist


PS2, Line 1102:       print_to_stderr("Command index out of range. Valid range: [1, {}]".format(history_length))
long line


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Sailesh Mukil (Code Review)" <ge...@cloudera.org>.
Sailesh Mukil has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 11: Code-Review+2

-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 11
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] Impala-992: Rerun past queries from history in shell

Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has posted comments on this change.

Change subject: Impala-992: Rerun past queries from history in shell
......................................................................


Patch Set 2:

(9 comments)

http://gerrit.cloudera.org:8080/#/c/7674/2//COMMIT_MSG
Commit Message:

PS2, Line 7: Impala
nit: capitalize


PS2, Line 9: @
What's the reason for picking "@" over "!"? The latter is used in shells and was suggested in the JIRA.


PS2, Line 12: History index is 1-based.
Can you give a usage example? Does the history count backwards or forwards in time?


http://gerrit.cloudera.org:8080/#/c/7674/2/shell/impala_shell.py
File shell/impala_shell.py:

PS2, Line 79: object
Why is this needed?


Line 1073:     else:
nit: You can remove the else and unindent the block, just like you do in the next method.


PS2, Line 1090: \n
Format on two lines to make it easier to read.


Line 1107:     return self.onecmd(cmd[:-1])
Does it always have a semicolon? .rstrip(";") might be more robust and clearer in its intention.


Line 1156:     """Parse the line into a command name and a string containing
Can you mention that this method will perform transformations?


PS2, Line 1157: line
what will 'line' contain?


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] Impala-992: Rerun past queries from history in shell

Posted by "Michael Brown (Code Review)" <ge...@cloudera.org>.
Michael Brown has posted comments on this change.

Change subject: Impala-992: Rerun past queries from history in shell
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/7674/2/shell/impala_shell.py
File shell/impala_shell.py:

PS2, Line 1102:       print_to_stderr("Command index out of range. Valid range: [1, {}]".format(history_length))
> long line
Please use explicit indexing or kwarg-style format: "{}".format(str) is not Python 2.6-compatible.


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#6).

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................

IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and a shortcut "@" to impala-shell
. Users can rerun a certain query by its index given by history command.
A valid index is an integer in [1, history_length] or
[-history_length, -1]. Negative values index history in reverse order.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
and "@-1;" reruns the last query. The rerun command itself won't appear
in history. The history index is 1-based and increasing. Old entries
might be truncated when impala-shell starts, and the indexes will be
realigned to 1, so the same index may refer to different commands among
multiple impala-shell instances.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 84 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/6
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 6
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Hello Sailesh Mukil,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/7674

to look at the new patch set (#8).

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................

IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and a shortcut "@" to impala-shell
. Users can rerun a certain query by its index given by history command.
A valid index is an integer in [1, history_length] or
[-history_length, -1]. Negative values index history in reverse order.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
and "@-1;" reruns the last query. The rerun command itself won't appear
in history. The history index is 1-based and increasing. Old entries
might be truncated when impala-shell starts, and the indexes will be
realigned to 1, so the same index may refer to different commands among
multiple impala-shell instances.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 84 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/8
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 8
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 5:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/7674/5//COMMIT_MSG
Commit Message:

Line 9: This patch adds a new command "rerun" and shortcut "@" to impala-shell.
> nit: and a shortcut.
Done


Line 10: User can rerun a certain query by its index given by history command.
> nit: users...
Done


PS5, Line 12: Negavie
> typo
Done


http://gerrit.cloudera.org:8080/#/c/7674/5/shell/impala_shell.py
File shell/impala_shell.py:

PS5, Line 1105: format
> I think this should be aligned with the . under the " according to PEP8.
Done.


Line 1111:     # Remove the semicolon at last.
> I think this comment now is not needed anymore, the command looks self expl
Done


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has submitted this change and it was merged.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and a shortcut "@" to impala-shell
. Users can rerun a certain query by its index given by history command.
A valid index is an integer in [1, history_length] or
[-history_length, -1]. Negative values index history in reverse order.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
and "@-1;" reruns the last query. The rerun command itself won't appear
in history. The history index is 1-based and increasing. Old entries
might be truncated when impala-shell starts, and the indexes will be
realigned to 1, so the same index may refer to different commands among
multiple impala-shell instances.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Reviewed-on: http://gerrit.cloudera.org:8080/7674
Reviewed-by: Sailesh Mukil <sa...@cloudera.com>
Tested-by: Impala Public Jenkins
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 81 insertions(+), 4 deletions(-)

Approvals:
  Impala Public Jenkins: Verified
  Sailesh Mukil: Looks good to me, approved



-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 12
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Hello Lars Volker, Sailesh Mukil,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/7674

to look at the new patch set (#10).

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................

IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and a shortcut "@" to impala-shell
. Users can rerun a certain query by its index given by history command.
A valid index is an integer in [1, history_length] or
[-history_length, -1]. Negative values index history in reverse order.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
and "@-1;" reruns the last query. The rerun command itself won't appear
in history. The history index is 1-based and increasing. Old entries
might be truncated when impala-shell starts, and the indexes will be
realigned to 1, so the same index may refer to different commands among
multiple impala-shell instances.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 81 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/10
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 10
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/7674/8/tests/shell/test_shell_interactive.py
File tests/shell/test_shell_interactive.py:

PS8, Line 236: rerun
Can you add one call using the "rerun" command?
Can you also add a test for something like "rerun foo;" that doesn't have an integer?


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 8
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Sailesh Mukil (Code Review)" <ge...@cloudera.org>.
Sailesh Mukil has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 7: Code-Review+1

(1 comment)

http://gerrit.cloudera.org:8080/#/c/7674/7/tests/shell/test_shell_interactive.py
File tests/shell/test_shell_interactive.py:

Line 235:   def test_rerun(self):
Add a brief comment describing what the test does:

"""Smoke test for the 'rerun' command"""


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 7
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 9:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/7674/8/tests/shell/test_shell_interactive.py
File tests/shell/test_shell_interactive.py:

PS8, Line 236: rerun
> Can you add one call using the "rerun" command?
Done


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 9
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#9).

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................

IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and a shortcut "@" to impala-shell
. Users can rerun a certain query by its index given by history command.
A valid index is an integer in [1, history_length] or
[-history_length, -1]. Negative values index history in reverse order.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
and "@-1;" reruns the last query. The rerun command itself won't appear
in history. The history index is 1-based and increasing. Old entries
might be truncated when impala-shell starts, and the indexes will be
realigned to 1, so the same index may refer to different commands among
multiple impala-shell instances.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 91 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/9
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 9
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 10:

(2 comments)

Comments addressed. Thanks for the review.

http://gerrit.cloudera.org:8080/#/c/7674/9/shell/impala_shell.py
File shell/impala_shell.py:

PS9, Line 1069: turn self._exe
> IMO, this function doesn't help us much. I'd revert to not having this func
Done


PS9, Line 1092:   return CmdSt
> Rename to 'history_len' for consistency with other functions.
Done


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 10
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Hello Sailesh Mukil,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/7674

to look at the new patch set (#9).

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................

IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and a shortcut "@" to impala-shell
. Users can rerun a certain query by its index given by history command.
A valid index is an integer in [1, history_length] or
[-history_length, -1]. Negative values index history in reverse order.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
and "@-1;" reruns the last query. The rerun command itself won't appear
in history. The history index is 1-based and increasing. Old entries
might be truncated when impala-shell starts, and the indexes will be
realigned to 1, so the same index may refer to different commands among
multiple impala-shell instances.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 91 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/9
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 9
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 4:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/7674/4/shell/impala_shell.py
File shell/impala_shell.py:

Line 1089:     """Rerun a command with an command index in history."""\
Unless you're trying to achieve something special, you can just have the string within """ span multiple lines.

"""Start here
Continue here. Then end with three " on a new line.
"""

See: https://www.python.org/dev/peps/pep-0008/#documentation-strings


PS4, Line 1164: character
nit: characters


PS4, Line 1166: This method transforms '@' into 'rerun' because this is a special
              :     character not defined in cmd.Cmd.
I'd probably leave out this sentence since it'll be hard to keep this in sync with the code. It seems sufficient to mention that there's some replacement going on and the curious reader can find all aliases in the code below.


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 11:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/1126/

-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 11
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#4).

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................

IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and shortcut "@" to impala-shell.
User can rerun a certain query by its index given by history command.
A valid index is an integer in [1, history_length] or
[-history_length, -1]. Negavie values index history in reverse order.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
and "@-1;" reruns the last query. The rerun command itself won't appear
in history. The history index is 1-based and increasing. Old entries
might be truncated when impala-shell starts, and the indexes will be
realigned to 1, so the same index may refer to different commands among
multiple impala-shell instances.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 85 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/4
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 7:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/7674/7/tests/shell/test_shell_interactive.py
File tests/shell/test_shell_interactive.py:

Line 235:   def test_rerun(self):
> Add a brief comment describing what the test does:
Done


-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 7
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change.

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................


Patch Set 11: Verified+1

-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 11
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-992: Rerun past queries from history in shell

Posted by "Tianyi Wang (Code Review)" <ge...@cloudera.org>.
Tianyi Wang has uploaded a new patch set (#7).

Change subject: IMPALA-992: Rerun past queries from history in shell
......................................................................

IMPALA-992: Rerun past queries from history in shell

This patch adds a new command "rerun" and a shortcut "@" to impala-shell
. Users can rerun a certain query by its index given by history command.
A valid index is an integer in [1, history_length] or
[-history_length, -1]. Negative values index history in reverse order.
For example, "@1;" or "rerun 1;" reruns the first query shown in history
and "@-1;" reruns the last query. The rerun command itself won't appear
in history. The history index is 1-based and increasing. Old entries
might be truncated when impala-shell starts, and the indexes will be
realigned to 1, so the same index may refer to different commands among
multiple impala-shell instances.

Testing: A test case test_rerun is added to
shell/test_shell_interactive.py

Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 83 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/74/7674/7
-- 
To view, visit http://gerrit.cloudera.org:8080/7674
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifc28e8ce07845343267224c3b9ccb71b29a524d2
Gerrit-PatchSet: 7
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>