Hi:
I have a simple concatenate UDF (for testing purpose) defined as:
public static class ConcatenateFunction extends ScalarFunction {
public String eval(@DataTypeHint(inputGroup = InputGroup.ANY) Object ...
inputs) { return Arrays.stream(inputs).map(i ->
i.toString()).collect( Collectors.joining(",")); }
}
and register it with the streaming table env:
tEnv.createTemporarySystemFunction("concatenateFunction",
ConcatenateFunction.class);
However when I call the function as shown below - I get an exception indicating
that the '*' is an unknown identifier as shown below.
Table concat = tEnv.sqlQuery( "SELECT
concatenateFunction(*) " + "FROM test_table" );
I am printing the rows at the end of the test application.
The exception is:
Exception in thread "main" org.apache.flink.table.api.ValidationException: SQL
validation failed. At line 1, column 29: Unknown identifier '*'
The document (User-defined Functions) shows how to call the function with all
args using scala/java :
env.from("MyTable").select(call(MyConcatFunction.class, $("*")));
But I could not find how to call the UDF using SQL syntax as shown above
(select concatenateFunction(*) from test_table).
Can you please let me know if there a way to pass all arguments to a UDF in SQL
?
Thanks