[Solved-1 Solution] How to Exit pig shell command ?



Pig Shell

  • Grunt is Pig's interactive shell. It enables users to enter Pig Latin interactively and provides a shell for users to interact with HDFS.
  • It does not provide a number of commands found in standard Unix shells, such as pipes, redirection, and background execution.

Problem:

  • When you enter some erraneous command in a Pig interactive shell environment, it enters into listening mode (>>) like below.
**grunt> Test_group = group Block2_Prep_filter by (page_visit_id as grp_page_visit_id, page_user_guid as grp_page_user_guid);
>> ;
>> 
>>**

Solution 1:

  • We have looked in the pig source code. This is called the secondary_prompt (found in PigScriptParser.jj, a a context free parser grammar file for JavaCC).
  • When we did control-d it exited and displayed
>> 2013-06-19 12:51:43,632 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000:
Error during parsing. Lexical error at line 83, column 0.  Encountered: <EOF> after : ""
  • Looking in Grunt class, at that point, it does:
parser.setInteractive(false);
return parser.parseStopOnError();

Related Searches to How to Exit pig shell command ?