Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
com.cloudera.impala.analysis.CreateUdaStmt Class Reference
Inheritance diagram for com.cloudera.impala.analysis.CreateUdaStmt:
Collaboration diagram for com.cloudera.impala.analysis.CreateUdaStmt:

Public Member Functions

 CreateUdaStmt (FunctionName fnSymbol, FunctionArgs args, TypeDef retTypeDef, TypeDef intermediateTypeDef, HdfsUri location, boolean ifNotExists, HashMap< CreateFunctionStmtBase.OptArg, String > optArgs)
 
void analyze (Analyzer analyzer) throws AnalysisException
 
String getComment ()
 
boolean getIfNotExists ()
 
TCreateFunctionParams toThrift ()
 
String toSql ()
 
void setIsExplain ()
 
boolean isExplain ()
 

Protected Member Functions

Function createFunction (FunctionName fnName, ArrayList< Type > argTypes, Type retType, boolean hasVarArgs)
 
String checkAndGetOptArg (OptArg key) throws AnalysisException
 
void checkOptArgNotSet (OptArg key) throws AnalysisException
 

Protected Attributes

final FunctionName fnName_
 
final FunctionArgs args_
 
final TypeDef retTypeDef_
 
final HdfsUri location_
 
final HashMap
< CreateFunctionStmtBase.OptArg,
String > 
optArgs_
 
final boolean ifNotExists_
 
Function fn_
 
String sqlString_
 
boolean isExplain_ = false
 

Private Member Functions

void reportCouldNotInferSymbol (String function) throws AnalysisException
 
String getSymbolSymbol (OptArg arg, String defaultSymbol)
 

Private Attributes

final TypeDef intermediateTypeDef_
 

Detailed Description

Represents a CREATE AGGREGATE FUNCTION statement.

Definition at line 32 of file CreateUdaStmt.java.

Constructor & Destructor Documentation

com.cloudera.impala.analysis.CreateUdaStmt.CreateUdaStmt ( FunctionName  fnSymbol,
FunctionArgs  args,
TypeDef  retTypeDef,
TypeDef  intermediateTypeDef,
HdfsUri  location,
boolean  ifNotExists,
HashMap< CreateFunctionStmtBase.OptArg, String >  optArgs 
)
inline

Builds a CREATE AGGREGATE FUNCTION statement

Parameters
fnName- Name of the function
fnArgs- List of types for the arguments to this function
retType- The type this function returns.
intermediateType_-The type used for the intermediate data.
location- Path in HDFS containing the UDA.
ifNotExists- If true, no errors are thrown if the function already exists
additionalArgs- Key/Value pairs for additional arguments. The keys are validated in analyze()

Definition at line 46 of file CreateUdaStmt.java.

References com.cloudera.impala.analysis.CreateUdaStmt.intermediateTypeDef_.

Member Function Documentation

void com.cloudera.impala.analysis.CreateUdaStmt.analyze ( Analyzer  analyzer) throws AnalysisException
inline

Perform semantic analysis of node and all of its children. Throws exception if any errors found.

Parameters
analyzer
Exceptions
AnalysisException

Implements com.cloudera.impala.analysis.ParseNode.

Definition at line 84 of file CreateUdaStmt.java.

References com.cloudera.impala.catalog.PrimitiveType.CHAR, com.cloudera.impala.analysis.CreateFunctionStmtBase.checkAndGetOptArg(), com.cloudera.impala.analysis.CreateFunctionStmtBase.checkOptArgNotSet(), com.cloudera.impala.analysis.CreateFunctionStmtBase.OptArg.CLOSE_FN, com.cloudera.impala.analysis.CreateFunctionStmtBase.OptArg.FINALIZE_FN, com.cloudera.impala.analysis.CreateFunctionStmtBase.fn_, com.cloudera.impala.analysis.CreateFunctionStmtBase.getComment(), com.cloudera.impala.catalog.Function.getNumArgs(), com.cloudera.impala.catalog.Function.getReturnType(), com.cloudera.impala.analysis.CreateUdaStmt.getSymbolSymbol(), com.cloudera.impala.catalog.Function.hasVarArgs(), com.cloudera.impala.analysis.CreateFunctionStmtBase.ifNotExists_, com.cloudera.impala.analysis.CreateFunctionStmtBase.OptArg.INIT_FN, com.cloudera.impala.analysis.CreateUdaStmt.intermediateTypeDef_, com.cloudera.impala.analysis.CreateFunctionStmtBase.OptArg.MERGE_FN, com.cloudera.impala.analysis.CreateFunctionStmtBase.optArgs_, com.cloudera.impala.analysis.CreateFunctionStmtBase.OptArg.PREPARE_FN, com.cloudera.impala.analysis.CreateUdaStmt.reportCouldNotInferSymbol(), com.cloudera.impala.analysis.CreateFunctionStmtBase.OptArg.SERIALIZE_FN, com.cloudera.impala.analysis.CreateFunctionStmtBase.sqlString_, com.cloudera.impala.analysis.CreateFunctionStmtBase.OptArg.SYMBOL, com.cloudera.impala.analysis.StatementBase.toSql(), com.cloudera.impala.catalog.Type.toSql(), com.cloudera.impala.analysis.CreateFunctionStmtBase.OptArg.UPDATE_FN, and com.cloudera.impala.catalog.PrimitiveType.VARCHAR.

String com.cloudera.impala.analysis.CreateFunctionStmtBase.checkAndGetOptArg ( OptArg  key) throws AnalysisException
inlineprotectedinherited
void com.cloudera.impala.analysis.CreateFunctionStmtBase.checkOptArgNotSet ( OptArg  key) throws AnalysisException
inlineprotectedinherited
Function com.cloudera.impala.analysis.CreateUdaStmt.createFunction ( FunctionName  fnName,
ArrayList< Type argTypes,
Type  retType,
boolean  hasVarArgs 
)
inlineprotected
String com.cloudera.impala.analysis.CreateFunctionStmtBase.getComment ( )
inlineinherited
boolean com.cloudera.impala.analysis.CreateFunctionStmtBase.getIfNotExists ( )
inlineinherited
String com.cloudera.impala.analysis.CreateUdaStmt.getSymbolSymbol ( OptArg  arg,
String  defaultSymbol 
)
inlineprivate
boolean com.cloudera.impala.analysis.StatementBase.isExplain ( )
inlineinherited
void com.cloudera.impala.analysis.CreateUdaStmt.reportCouldNotInferSymbol ( String  function) throws AnalysisException
inlineprivate
void com.cloudera.impala.analysis.StatementBase.setIsExplain ( )
inlineinherited
String com.cloudera.impala.analysis.StatementBase.toSql ( )
inlineinherited

Print SQL syntax corresponding to this node.

See Also
com.cloudera.impala.parser.ParseNode::toSql()

Implements com.cloudera.impala.analysis.ParseNode.

Definition at line 41 of file StatementBase.java.

Referenced by com.cloudera.impala.analysis.CreateUdaStmt.analyze(), and com.cloudera.impala.analysis.QueryStmt.createSortInfo().

TCreateFunctionParams com.cloudera.impala.analysis.CreateFunctionStmtBase.toThrift ( )
inlineinherited

Member Data Documentation

final TypeDef com.cloudera.impala.analysis.CreateUdaStmt.intermediateTypeDef_
private
final HdfsUri com.cloudera.impala.analysis.CreateFunctionStmtBase.location_
protectedinherited
final TypeDef com.cloudera.impala.analysis.CreateFunctionStmtBase.retTypeDef_
protectedinherited
String com.cloudera.impala.analysis.CreateFunctionStmtBase.sqlString_
protectedinherited

The documentation for this class was generated from the following file: