Making Custom Auto completion mechanism for Pig

One handy feature of pig’s Grunt shell is completion mechanism, which will try to complete

Pig Latin keywords and functions when you press the Tab key. For example, consider

the following incomplete line:

grunt> a = foreach b ge

If you press the Tab key at this point, ge will expand to generate, a Pig Latin keyword:

grunt> a = foreach b generate

We can customize the completion tokens by putting our necessary tokens in a file named autocomplete and put it in the pig class path or in the directory where we are invoking the grunt shell

For example: I created a file named autocomplete which contains the tokens

Julie

India

Software

Engineer

Hadoop

Bigdata

Then after saving this if u press the corresponding alphabet and press tab, it will display the choices for autocompletion.

Note: The tokens that I mentioned above is not related to pig commands or funtions. It is just for an example only. Like this you can create your own custom scripts or tokens for making the scripting handy

Advertisements

About amalgjose
I am an Electrical Engineer by qualification, now I am working as a Software Engineer. I am very much interested in Electrical, Electronics, Mechanical and now in Software fields. I like exploring things in these fields. I like travelling, long drives and very much addicted to music.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: