/** * Returns function that implements given operator call. * @return function that implements given operator call */ public TableFunction getFunction() { return (TableFunction) super.getFunction(); }
private SqlOperator getSqlOperator(SamzaSqlScalarFunctionImpl scalarFunction) { return new SqlUserDefinedFunction(new SqlIdentifier(scalarFunction.getUdfName(), SqlParserPos.ZERO), o -> scalarFunction.getReturnType(o.getTypeFactory()), null, Checker.ANY_CHECKER, null, scalarFunction); }
RexCall mockFlattenProject = mock(RexCall.class); SqlUserDefinedFunction sqlFlattenUdf = mock(SqlUserDefinedFunction.class); when(sqlFlattenUdf.getName()).thenReturn("flatten"); List<RexNode> flattenUdfOperands = new ArrayList<>(); RexInputRef rexInputRef = mock(RexInputRef.class);
private SqlOperator getSqlOperator(SamzaSqlScalarFunctionImpl scalarFunction) { return new SqlUserDefinedFunction(new SqlIdentifier(scalarFunction.getUdfName(), SqlParserPos.ZERO), o -> scalarFunction.getReturnType(o.getTypeFactory()), null, Checker.ANY_CHECKER, null, scalarFunction); }
final List<RelDataType> paramTypes = toSql(argTypes); if (function instanceof ScalarFunction) { return new SqlUserDefinedFunction(name, infer((ScalarFunction) function), InferTypes.explicit(argTypes), typeChecker, paramTypes, function); } else if (function instanceof AggregateFunction) {
/** * Returns function that implements given operator call. * @return function that implements given operator call */ public TableFunction getFunction() { return (TableFunction) super.getFunction(); }
final List<RelDataType> paramTypes = toSql(typeFactory, argTypes); if (function instanceof ScalarFunction) { return new SqlUserDefinedFunction(name, infer((ScalarFunction) function), InferTypes.explicit(argTypes), typeChecker, paramTypes, function); } else if (function instanceof AggregateFunction) {
public CallImplementor get(final SqlOperator operator) { if (operator instanceof SqlUserDefinedFunction) { org.apache.calcite.schema.Function udf = ((SqlUserDefinedFunction) operator).getFunction(); if (!(udf instanceof ImplementableFunction)) { throw new IllegalStateException("User defined function " + operator + " must implement ImplementableFunction"); } return ((ImplementableFunction) udf).getImplementor(); } return map.get(operator); }
final List<RelDataType> paramTypes = toSql(typeFactory, argTypes); if (function instanceof ScalarFunction) { return new SqlUserDefinedFunction(name, infer((ScalarFunction) function), InferTypes.explicit(argTypes), typeChecker, paramTypes, function); } else if (function instanceof AggregateFunction) {
public CallImplementor get(final SqlOperator operator) { if (operator instanceof SqlUserDefinedFunction) { org.apache.calcite.schema.Function udf = ((SqlUserDefinedFunction) operator).getFunction(); if (!(udf instanceof ImplementableFunction)) { throw new IllegalStateException("User defined function " + operator + " must implement ImplementableFunction"); } return ((ImplementableFunction) udf).getImplementor(); } return map.get(operator); }