You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Amir Youssefi (JIRA)" <ji...@apache.org> on 2008/07/17 04:45:31 UTC

[jira] Commented: (PIG-139) Command line editing, history and more for Grunt

    [ https://issues.apache.org/jira/browse/PIG-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614203#action_12614203 ] 

Amir Youssefi commented on PIG-139:
-----------------------------------

It works beautifully. 

Please 
 - add Apache  License on top of files e.g. PigCompletor.java
 - use four spaces for indentation instead of Tab which is there. (see http://wiki.apache.org/pig/HowToContribute).

On discussed topics: 

 1. Using Grammer (org/apache/pig/impl/logicalLayer/parser/grammar) doesn't seem to be practical. Other options are: 

a) org/apache/pig/impl/logicalLayer/parser/QueryParser.jjt   (for language)
b) org/apache/pig/tools/pigscript/parser/PigScriptParser.jj  (for grunt)

Here is a snippet of it: 

// List all the keywords in the language
TOKEN : { <DEFINE : "define"> }
TOKEN : { <LOAD : "load"> }
TOKEN : { <FILTER : "filter"> }
TOKEN : { <FOREACH : "foreach"> }
TOKEN : { <MATCHES : "matches"> }
TOKEN : { <ORDER : "order"> }
TOKEN : { <COGROUP : "cogroup"> }
...

this part was simple and if it was just that, we could extract it automatically with small effort. It gets more complicated with other TOKEN definitions in above file. It seems to be too complicated to worth the effort now. 

If we were to do more extended auto completion then we may needed that. For instance auto completion for left hand side names or meta data $fooo, or user declared values (with %declare)

For now, perhaps we can simply put list of TOKENS for auto completion in an external text file. It is manually maintained so users can expand it without a need for full compile/deployment.  This makes adding Piggy Bank tokens, commonly used paths etc. easy for users. They just edit this text file and add a few things and it works right away.

2. Good idea for future. Perhaps other types are auto-completion  e.g. LEFT HAND SIDE completion will be of higher priority. 

3. Absolutely correct. It's easy to add but may make auto completion slow. Perhaps we have it off by default and then let use turn it on if they are willing to lower the performance or if they are using local file system. Implementation of this is of low priority. As discussed above, having an external keywords text file can help user auto complete common paths which is basically a hack but perhaps useful for long paths.

4. Good idea.

Overall, this was a great first step and enhances usability of grunt greatly.

Thanks for the contribution. 

> Command line editing, history and more for Grunt
> ------------------------------------------------
>
>                 Key: PIG-139
>                 URL: https://issues.apache.org/jira/browse/PIG-139
>             Project: Pig
>          Issue Type: Improvement
>         Environment: Grunt
>            Reporter: Amir Youssefi
>         Attachments: jline-0.9.94.jar, jline.patch
>
>
> We need to add support of command line editing, history and more for Grunt. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.