org.apache.hadoop.hive.ql.processors
Class CompileProcessor

java.lang.Object
  extended by 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.


Field Summary
static String AS
           
static SessionState.LogHelper console
           
static String GROOVY
           
static String IO_TMP_DIR
           
static org.apache.commons.logging.Log LOG
           
static String NAMED
           
 
Constructor Summary
CompileProcessor()
           
 
Method Summary
 String getCode()
           
 String getCommand()
           
 String getLang()
           
 String getNamed()
           
 void init()
           
 CommandProcessorResponse run(String command)
          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.
 void setCode(String code)
           
 void setLang(String lang)
           
 void setNamed(String named)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

CompileProcessor

public CompileProcessor()
Method Detail

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.