[
https://issues.apache.org/jira/browse/BEAM-7787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16895695#comment-16895695
]
Yang Zhang commented on BEAM-7787:
----------------------------------
Thanks for the reply, Andrew!
According to your suggestion, I have just tried the following UDF. However,
during planning phase, it looks like String[] is not primitive type, and
```Exception in thread "main" java.lang.NullPointerException: Null type``` is
thrown out.
public static class UDF implements SerializableFunction<String, String[]>
Incidentally, do you have an example for
org.apache.calcite.schema.TranslatableTable as parameter for UDF? Thank you!
> SQL should support complex types for UDF and have documentation
> ---------------------------------------------------------------
>
> Key: BEAM-7787
> URL: https://issues.apache.org/jira/browse/BEAM-7787
> Project: Beam
> Issue Type: New Feature
> Components: dsl-sql
> Reporter: Yang Zhang
> Priority: Major
> Attachments: Screen Shot 2019-07-24 at 4.58.32 PM.png
>
>
> In Beam UDF, is it feasible to return a list? For example, the UDF function
> is defined as (input) String -> (output) List<String>,
> ```public static class UDF implements SerializableFunction<String,
> List<String>>```
>
> I got a nullpointerexception if a list is returned.
>
> Best,
> Yang
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)