Hello, i am trying to use flink sql with custom UD...
# troubleshooting
h
Hello, i am trying to use flink sql with custom UDF that can output a json. Is there a way to write a generic function that can output a json ? I am having to use
Copy code
@FunctionHint(
        output = @DataTypeHint(value = "ARRAY<ROW<target STRING, rights ARRAY<STRING>>>", bridgedTo = ArrayData.class))
function hint this way is very specific, if i need a new field, i have to write another UDF, is there a way to make the out a json and be generic ?
s
JSON is a specific data format that has nothing to do with Flink SQL. Are you saying you need to support a complex type like an array of objects?
You might want to check the RAW type instead of a specific ROW<>, but you'll lose some type safety
h
@sap1ens do u have an example of how to use RAW type. I haven’t been able to get it to work