org.apache.hadoop.hive.ql.processors
Class CompileProcessor
java.lang.Object
org.apache.hadoop.hive.ql.processors.CompileProcessor
- All Implemented Interfaces:
- CommandProcessor
public class CompileProcessor
- extends Object
- implements CommandProcessor
Processor allows users to build code inside a hive session, then
use this code as a UDF, Serde, or even a more complex entity like an
input format or hook.
Note: This class is stateful and not thread safe. Create a new instance for
each invocation of CompileProcessor.
LOG
public static final org.apache.commons.logging.Log LOG
console
public static final SessionState.LogHelper console
IO_TMP_DIR
public static final String IO_TMP_DIR
- See Also:
- Constant Field Values
GROOVY
public static final String GROOVY
- See Also:
- Constant Field Values
AS
public static final String AS
- See Also:
- Constant Field Values
NAMED
public static final String NAMED
- See Also:
- Constant Field Values
CompileProcessor
public CompileProcessor()
init
public void init()
- Specified by:
init
in interface CommandProcessor
run
public CommandProcessorResponse run(String command)
throws CommandNeedRetryException
- User supplies dynamic code in this format:
COMPILE ` some code here ` AS groovy NAMED something.groovy;
CompileProcessor will compile and package this code into a jar. The jar
will be added to the session state via the session state's
ADD RESOURCE command.
- Specified by:
run
in interface CommandProcessor
- Parameters:
command
- a String to be compiled
- Returns:
- CommandProcessorResponse with 0 for success and 1 for failure
- Throws:
CommandNeedRetryException
getLang
public String getLang()
setLang
public void setLang(String lang)
getCode
public String getCode()
setCode
public void setCode(String code)
getNamed
public String getNamed()
setNamed
public void setNamed(String named)
getCommand
public String getCommand()
Copyright © 2014 The Apache Software Foundation. All rights reserved.