org.apache.pig.tools.grunt
Class GruntParser
java.lang.Object
org.apache.pig.tools.pigscript.parser.PigScriptParser
org.apache.pig.tools.grunt.GruntParser
- All Implemented Interfaces:
- org.apache.pig.tools.pigscript.parser.PigScriptParserConstants
public class GruntParser
- extends org.apache.pig.tools.pigscript.parser.PigScriptParser
Fields inherited from class org.apache.pig.tools.pigscript.parser.PigScriptParser |
jj_nt, mConsoleReader, mInteractive, token, token_source |
Fields inherited from interface org.apache.pig.tools.pigscript.parser.PigScriptParserConstants |
ALIASES, AS, BAG_CONSTANT, BRIEF, CAT, CD, CLEAR, COPY, COPYFROMLOCAL, COPYTOLOCAL, DEFAULT, DESCRIBE, DIGIT, DOT, DUMP, EOF, EOL, EXEC, EXPLAIN, FLOAT, FS, FSSPECIALCHAR, GENERATE, HELP, HISTORY, IDENTIFIER, ILLUSTRATE, IN_BLOCK, IN_COMMAND, IN_DOUBLE_QUOTED_STRING, IN_STRING, INTEGER, KILL, LETTER, LS, MKDIR, MOVE, MULTI_LINE_COMMENT, N, NUMBER, OUT, PARAM, PARAM_FILE, PATH, PIG, PIG_END, PIG_START, PWD, QUIT, QUOTE, QUOTEDSTRING, REGISTER, REMOVE, REMOVEFORCE, RUN, SCHEMA_DEFINITION, SCRIPT, SCRIPT_DONE, SEMICOLON, SET, SH, SINGLE_LINE_COMMENT, SPECIALCHAR, SQL, SQL_END, SQL_START, tokenImage, USING |
Method Summary |
protected void |
explainCurrentBatch()
|
protected void |
explainCurrentBatch(boolean dontPrintOutput)
|
boolean |
isDone()
|
void |
parseOnly()
|
int[] |
parseStopOnError()
|
int[] |
parseStopOnError(boolean sameBatch)
Parses Pig commands in either interactive mode or batch mode. |
protected void |
printAliases()
|
protected void |
printClear()
|
protected void |
printHelp()
|
protected void |
processCat(String path)
|
protected void |
processCD(String path)
|
protected void |
processCopy(String src,
String dst)
|
protected void |
processCopyFromLocal(String src,
String dst)
|
protected void |
processCopyToLocal(String src,
String dst)
|
protected void |
processDescribe(String alias)
|
protected void |
processDump(String alias)
|
protected void |
processExplain(String alias,
String script,
boolean isVerbose,
String format,
String target,
List<String> params,
List<String> files)
|
protected void |
processExplain(String alias,
String script,
boolean isVerbose,
String format,
String target,
List<String> params,
List<String> files,
boolean dontPrintOutput)
|
protected void |
processFsCommand(String[] cmdTokens)
|
protected void |
processHistory(boolean withNumbers)
|
protected void |
processIllustrate(String alias,
String script,
String target,
List<String> params,
List<String> files)
|
protected void |
processKill(String jobid)
|
protected void |
processLS(String path)
|
protected void |
processMkdir(String dir)
|
protected void |
processMove(String src,
String dst)
|
protected void |
processPig(String cmd)
|
protected void |
processPWD()
|
protected void |
processRegister(String jar)
|
protected void |
processRegister(String path,
String scriptingLang,
String namespace)
|
protected void |
processRemove(String path,
String options)
|
protected void |
processScript(String script,
boolean batch,
List<String> params,
List<String> files)
|
protected void |
processSet(String key,
String value)
|
protected void |
processShCommand(String[] cmdTokens)
|
protected void |
processSQLCommand(String cmd)
|
void |
prompt()
|
protected void |
quit()
|
static int |
runSQLCommand(String hcatBin,
String cmd,
boolean mInteractive)
|
void |
setInteractive(boolean isInteractive)
|
void |
setLoadOnly(boolean loadOnly)
|
void |
setParams(PigServer pigServer)
|
void |
setScriptIllustrate()
|
void |
setValidateEachStatement(boolean b)
|
Methods inherited from class org.apache.pig.tools.pigscript.parser.PigScriptParser |
Clear, disable_tracing, enable_tracing, Explain, generateParseException, GetKey, getLineNumber, getNextToken, GetPath, GetReserved, getToken, GetValue, History, Illustrate, parse, ReInit, ReInit, ReInit, ReInit, Script, setConsoleReader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GruntParser
public GruntParser(Reader stream)
GruntParser
public GruntParser(InputStream stream,
String encoding)
GruntParser
public GruntParser(InputStream stream)
GruntParser
public GruntParser(org.apache.pig.tools.pigscript.parser.PigScriptParserTokenManager tm)
setInteractive
public void setInteractive(boolean isInteractive)
- Overrides:
setInteractive
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
setValidateEachStatement
public void setValidateEachStatement(boolean b)
parseStopOnError
public int[] parseStopOnError()
throws IOException,
org.apache.pig.tools.pigscript.parser.ParseException
- Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException
parseStopOnError
public int[] parseStopOnError(boolean sameBatch)
throws IOException,
org.apache.pig.tools.pigscript.parser.ParseException
- Parses Pig commands in either interactive mode or batch mode.
In interactive mode, executes the plan right away whenever a
STORE command is encountered.
- Throws:
IOException,
- ParseException
IOException
org.apache.pig.tools.pigscript.parser.ParseException
setLoadOnly
public void setLoadOnly(boolean loadOnly)
setParams
public void setParams(PigServer pigServer)
setScriptIllustrate
public void setScriptIllustrate()
prompt
public void prompt()
- Specified by:
prompt
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
quit
protected void quit()
- Specified by:
quit
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
isDone
public boolean isDone()
parseOnly
public void parseOnly()
throws IOException,
org.apache.pig.tools.pigscript.parser.ParseException
- Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException
processDescribe
protected void processDescribe(String alias)
throws IOException
- Specified by:
processDescribe
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processExplain
protected void processExplain(String alias,
String script,
boolean isVerbose,
String format,
String target,
List<String> params,
List<String> files)
throws IOException,
org.apache.pig.tools.pigscript.parser.ParseException
- Specified by:
processExplain
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException
processExplain
protected void processExplain(String alias,
String script,
boolean isVerbose,
String format,
String target,
List<String> params,
List<String> files,
boolean dontPrintOutput)
throws IOException,
org.apache.pig.tools.pigscript.parser.ParseException
- Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException
explainCurrentBatch
protected void explainCurrentBatch()
throws IOException
- Throws:
IOException
explainCurrentBatch
protected void explainCurrentBatch(boolean dontPrintOutput)
throws IOException
- Throws:
IOException
printAliases
protected void printAliases()
throws IOException
- Specified by:
printAliases
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
printClear
protected void printClear()
- Specified by:
printClear
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
processRegister
protected void processRegister(String jar)
throws IOException
- Specified by:
processRegister
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processRegister
protected void processRegister(String path,
String scriptingLang,
String namespace)
throws IOException,
org.apache.pig.tools.pigscript.parser.ParseException
- Specified by:
processRegister
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException
processScript
protected void processScript(String script,
boolean batch,
List<String> params,
List<String> files)
throws IOException,
org.apache.pig.tools.pigscript.parser.ParseException
- Specified by:
processScript
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException
processSet
protected void processSet(String key,
String value)
throws IOException,
org.apache.pig.tools.pigscript.parser.ParseException
- Specified by:
processSet
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException
processCat
protected void processCat(String path)
throws IOException
- Specified by:
processCat
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processCD
protected void processCD(String path)
throws IOException
- Specified by:
processCD
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processDump
protected void processDump(String alias)
throws IOException
- Specified by:
processDump
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processIllustrate
protected void processIllustrate(String alias,
String script,
String target,
List<String> params,
List<String> files)
throws IOException,
org.apache.pig.tools.pigscript.parser.ParseException
- Specified by:
processIllustrate
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException
processKill
protected void processKill(String jobid)
throws IOException
- Specified by:
processKill
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processLS
protected void processLS(String path)
throws IOException
- Specified by:
processLS
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processPWD
protected void processPWD()
throws IOException
- Specified by:
processPWD
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processHistory
protected void processHistory(boolean withNumbers)
- Specified by:
processHistory
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
printHelp
protected void printHelp()
- Specified by:
printHelp
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
processMove
protected void processMove(String src,
String dst)
throws IOException
- Specified by:
processMove
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processCopy
protected void processCopy(String src,
String dst)
throws IOException
- Specified by:
processCopy
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processCopyToLocal
protected void processCopyToLocal(String src,
String dst)
throws IOException
- Specified by:
processCopyToLocal
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processCopyFromLocal
protected void processCopyFromLocal(String src,
String dst)
throws IOException
- Specified by:
processCopyFromLocal
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processMkdir
protected void processMkdir(String dir)
throws IOException
- Specified by:
processMkdir
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processPig
protected void processPig(String cmd)
throws IOException
- Specified by:
processPig
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processRemove
protected void processRemove(String path,
String options)
throws IOException
- Specified by:
processRemove
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processFsCommand
protected void processFsCommand(String[] cmdTokens)
throws IOException
- Specified by:
processFsCommand
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
processShCommand
protected void processShCommand(String[] cmdTokens)
throws IOException
- Specified by:
processShCommand
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
runSQLCommand
public static int runSQLCommand(String hcatBin,
String cmd,
boolean mInteractive)
throws IOException
- Throws:
IOException
processSQLCommand
protected void processSQLCommand(String cmd)
throws IOException
- Specified by:
processSQLCommand
in class org.apache.pig.tools.pigscript.parser.PigScriptParser
- Throws:
IOException
Copyright © 2007-2012 The Apache Software Foundation