Package net.hydromatic.morel.foreign
Class CalciteFunctions
- java.lang.Object
-
- net.hydromatic.morel.foreign.CalciteFunctions
-
public class CalciteFunctions extends Object
Calcite table-valued user-defined function that evaluates a Morel expression and returns the result as a relation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static interfaceCalciteFunctions.ArgOperand to a user-defined function.static classCalciteFunctions.ContextExecution context.static classCalciteFunctions.MorelApplyFunctionCalcite user-defined function that applies a Morel function (or closure) to an argument.static classCalciteFunctions.MorelScalarFunctionCalcite user-defined function that evaluates a Morel string and returns a scalar value.static classCalciteFunctions.MorelTableFunctionCalcite user-defined function that evaluates a Morel string and returns a table.
-
Field Summary
Fields Modifier and Type Field Description static org.apache.calcite.sql.SqlOperatorAPPLY_OPERATORstatic org.apache.calcite.sql.SqlOperatorSCALAR_OPERATORstatic org.apache.calcite.sql.SqlOperatorTABLE_OPERATORstatic ThreadLocal<CalciteFunctions.Context>THREAD_ENVstatic ThreadLocal<EvalEnv>THREAD_EVAL_ENVUsed to pass Morel's evaluation environment into Calcite, so that it is available if Calcite calls back into Morel.
-
Constructor Summary
Constructors Modifier Constructor Description privateCalciteFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static org.apache.calcite.rel.type.RelDataTypeinferReturnType(org.apache.calcite.sql.SqlOperatorBinding b)
-
-
-
Field Detail
-
THREAD_ENV
public static final ThreadLocal<CalciteFunctions.Context> THREAD_ENV
-
THREAD_EVAL_ENV
public static final ThreadLocal<EvalEnv> THREAD_EVAL_ENV
Used to pass Morel's evaluation environment into Calcite, so that it is available if Calcite calls back into Morel.It would be better if we passed the environment, or variables we know are needed, as an argument at the Calcite-to-Morel (see
Calcite.code(net.hydromatic.morel.compile.Environment, org.apache.calcite.rel.RelNode, net.hydromatic.morel.type.Type)) and Morel-to-Calcite (seeTABLE_OPERATORandSCALAR_OPERATOR) boundaries.
-
TABLE_OPERATOR
public static final org.apache.calcite.sql.SqlOperator TABLE_OPERATOR
-
SCALAR_OPERATOR
public static final org.apache.calcite.sql.SqlOperator SCALAR_OPERATOR
-
APPLY_OPERATOR
public static final org.apache.calcite.sql.SqlOperator APPLY_OPERATOR
-
-