|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.sql.SqlOperator org.eigenbase.sql.SqlFunction net.sf.farrago.query.FarragoUserDefinedRoutine
public class FarragoUserDefinedRoutine
FarragoUserDefinedRoutine extends SqlFunction
with a repository
reference to a specific user-defined routine.
Field Summary | |
---|---|
private FemJar |
femJar
|
private FarragoPreparingStmt |
preparingStmt
|
private static String |
RETURN_PREFIX
|
private RelDataType |
returnType
|
private FemRoutine |
routine
|
private FarragoSessionStmtValidator |
stmtValidator
|
Fields inherited from class org.eigenbase.sql.SqlOperator |
---|
MaxPrec, NL |
Constructor Summary | |
---|---|
FarragoUserDefinedRoutine(FarragoSessionStmtValidator stmtValidator,
FarragoPreparingStmt preparingStmt,
FemRoutine routine,
RelDataType returnType,
RelDataType[] paramTypes)
|
Method Summary | |
---|---|
static String |
addReturnPrefix(String body)
|
boolean |
canImplement(RexCall call)
Tests whether it is possible to implement a call. |
private static boolean |
checkCompatibility(SqlTypeName t1,
SqlTypeName t2)
|
FemRoutine |
getFemRoutine()
|
FemJar |
getJar()
|
Method |
getJavaMethod()
Uses an external Java routine definition plus reflection to find a corresponding Java method. |
FarragoPreparingStmt |
getPreparingStmt()
|
RelDataType |
getReturnType()
|
private static List<String> |
getRoutineParamNames(FemRoutine femRoutine)
|
boolean |
hasDefinition()
|
static boolean |
hasReturnPrefix(String body)
|
Expression |
implement(RexToOJTranslator translator,
RexCall call,
Expression[] operands)
Implements a single RexCall . |
RelDataType |
inferReturnType(SqlOperatorBinding opBinding)
Infers the return type of an invocation of this operator; only called after the number and types of operands have already been validated. |
boolean |
isDeterministic()
|
boolean |
isDynamicFunction()
|
boolean |
isTableFunction()
|
protected void |
preValidateCall(SqlValidator validator,
SqlValidatorScope scope,
SqlCall call)
Receives notification that validation of a call to this operator is beginning. |
static String |
removeReturnPrefix(String body)
|
boolean |
requiresDecimalExpansion()
Method to check if call requires expansion when it has decimal operands. |
private Expression |
translateOperand(FarragoRexToOJTranslator farragoTranslator,
FemRoutineParameter param,
Expression argExpr,
Class javaParamClass,
RelDataType paramType)
|
private boolean |
validateListParams(Method javaMethod,
Class[] javaParamClasses)
Examines parameters corresponding to List parameters and ensures that they are List<String> types |
Methods inherited from class org.eigenbase.sql.SqlFunction |
---|
deriveType, getFunctionType, getNameAsId, getParamTypes, getSqlIdentifier, getSyntax, isQuantifierAllowed, unparse, validateCall, validateQuantifier |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final String RETURN_PREFIX
private final FemRoutine routine
private final FarragoSessionStmtValidator stmtValidator
private final FarragoPreparingStmt preparingStmt
private FemJar femJar
private RelDataType returnType
Constructor Detail |
---|
public FarragoUserDefinedRoutine(FarragoSessionStmtValidator stmtValidator, FarragoPreparingStmt preparingStmt, FemRoutine routine, RelDataType returnType, RelDataType[] paramTypes)
Method Detail |
---|
private static List<String> getRoutineParamNames(FemRoutine femRoutine)
public FarragoPreparingStmt getPreparingStmt()
public FemRoutine getFemRoutine()
protected void preValidateCall(SqlValidator validator, SqlValidatorScope scope, SqlCall call)
SqlOperator
preValidateCall
in class SqlOperator
validator
- invoking validatorscope
- validation scopecall
- the call being validatedpublic RelDataType getReturnType()
public boolean isTableFunction()
public FemJar getJar()
public Method getJavaMethod() throws SqlValidatorException
SqlValidatorException
- if matching Java method could not be
foundprivate static boolean checkCompatibility(SqlTypeName t1, SqlTypeName t2)
private boolean validateListParams(Method javaMethod, Class[] javaParamClasses)
javaMethod
- the java method containing the parametersjavaParamClasses
- classes of the parameter
public Expression implement(RexToOJTranslator translator, RexCall call, Expression[] operands)
OJRexImplementor
RexCall
.
implement
in interface OJRexImplementor
translator
- provides translation contextcall
- the call to be translatedoperands
- call's operands, which have already been translated
independentlypublic boolean canImplement(RexCall call)
OJRexImplementor
canImplement
in interface OJRexImplementor
call
- the call for which translation is being considered
private Expression translateOperand(FarragoRexToOJTranslator farragoTranslator, FemRoutineParameter param, Expression argExpr, Class javaParamClass, RelDataType paramType)
public boolean hasDefinition()
public boolean requiresDecimalExpansion()
SqlOperator
requiresDecimalExpansion
in class SqlOperator
public static String removeReturnPrefix(String body)
public static String addReturnPrefix(String body)
public static boolean hasReturnPrefix(String body)
public boolean isDynamicFunction()
isDynamicFunction
in class SqlOperator
public boolean isDeterministic()
isDeterministic
in class SqlOperator
public RelDataType inferReturnType(SqlOperatorBinding opBinding)
SqlOperator
SqlReturnTypeInference
to the constructor.
inferReturnType
in class SqlOperator
opBinding
- description of invocation (not necessarily a SqlCall
)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |