use of org.apache.calcite.schema.impl.ScalarFunctionImpl in project calcite by apache.
the class CalciteCatalogReader method infer.
private static SqlReturnTypeInference infer(final ScalarFunction function) {
return new SqlReturnTypeInference() {
public RelDataType inferReturnType(SqlOperatorBinding opBinding) {
final RelDataTypeFactory typeFactory = opBinding.getTypeFactory();
final RelDataType type;
if (function instanceof ScalarFunctionImpl) {
type = ((ScalarFunctionImpl) function).getReturnType(typeFactory, opBinding);
} else {
type = function.getReturnType(typeFactory);
}
return toSql(typeFactory, type);
}
};
}
Aggregations