use of io.confluent.ksql.function.ParameterInfo in project ksql by confluentinc.
the class DescribeFunctionExecutor method getFunctionInfo.
private static FunctionInfo getFunctionInfo(final List<ParameterInfo> argTypes, final ParamType returnTypeSchema, final String description, final boolean variadic) {
final List<ArgumentInfo> args = new ArrayList<>();
for (int i = 0; i < argTypes.size(); i++) {
final ParameterInfo param = argTypes.get(i);
final boolean isVariadic = variadic && i == (argTypes.size() - 1);
final String type = isVariadic ? ((ArrayType) param.type()).element().toString() : param.type().toString();
args.add(new ArgumentInfo(param.name(), type, param.description(), isVariadic));
}
return new FunctionInfo(args, returnTypeSchema.toString(), description);
}
Aggregations