[
https://issues.apache.org/jira/browse/BEAM-7787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16895616#comment-16895616
]
Andrew Pilloud commented on BEAM-7787:
--------------------------------------
The types that are known to work (tested) are Integer, String,
org.joda.time.Instant, java.sql.Timestamp, and
org.apache.calcite.schema.TranslatableTable. I would expect all other primitive
types to work. Complex types are currently not tested or supported, but they
should work.
Our support for UDFs is based on calcite, so unknown types are passed directly
there. Rreturning native calcite types mostly works. I haven't tested it but
for this case try an array instead of a list:
{code:java}
public static class UDF implements SerializableFunction<String, String[]>
{code}
> SQL transform crashes when UDF returns a list
> ---------------------------------------------
>
> Key: BEAM-7787
> URL: https://issues.apache.org/jira/browse/BEAM-7787
> Project: Beam
> Issue Type: Bug
> 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)