You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Cheolsoo Park (JIRA)" <ji...@apache.org> on 2013/02/07 21:45:13 UTC

[jira] [Reopened] (PIG-2994) Grunt shortcuts

     [ https://issues.apache.org/jira/browse/PIG-2994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cheolsoo Park reopened PIG-2994:
--------------------------------


While debugging TestGrunt, I came to conclude that the fix should be made to the patch of this jira.

{{PIG-2994.3.patch}} introduced a backward incompatible behavior to explain when it being used in PigServer.

Originally, explain with no alias followed by a script name used to perform explain on the script. But now it tries to perform explain on the previous alias.

The following change restores the original behavior. I verified that this fixes the test failures in TestGrunt:
{code}
-        if (alias == null) {
+        if (alias == null && script == null) {
             alias = mPigServer.getPigContext().getLastAlias();
             // if explain is used immediately after launching grunt shell then
             // last defined alias will be null
-            if (alias == null && script == null) {
+            if (alias == null) {
                 throw new ParseException("'explain' statement must be on an alias or on a script.");
             }
{code}
                
> Grunt shortcuts
> ---------------
>
>                 Key: PIG-2994
>                 URL: https://issues.apache.org/jira/browse/PIG-2994
>             Project: Pig
>          Issue Type: New Feature
>          Components: grunt
>            Reporter: Prasanth J
>            Assignee: Prasanth J
>            Priority: Minor
>         Attachments: PIG-2994.1.git.patch, PIG-2994.2.git.patch, PIG-2994.3.git.patch
>
>
> This feature is aimed at providing shortcuts for frequently used commands like illustrate, dump, explain, describe, quit, help etc. This feature is inspired from postgres(psql) shortcuts. I tried implementing a simple shortcut for quitting the grunt shell using \q with very minimal changes. I think this feature will help save many keystrokes for users. If this feature looks useful I can submit the current patch for review and go ahead with implementing the following shortcuts
> \i <alias> - illustrate
> \e <alias> - explain
> \de <alias> - describe
> \du <alias> - dump 
> \h - help
> This will also be useful to view information about tables/statistics stored in HCatalog similar to the way psql does. 
> \dt <alias> - display table
> \dm - display metadata
> etc..
> except \t, \r and \n delimiters we should be able to use all other characters as shortcuts. 
> Please let me know your thoughts.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira