Hi all
When I use udf, it throws Unable to serialize Exception as follows: Exception in thread "main" org.apache.flink.table.api.ValidationException: Unable to serialize object 'UserTableFunction' of class ‘....udtf.UserTableFunction'. at org.apache.flink.table.utils.EncodingUtils.encodeObjectToString(EncodingUtils.java:72) at org.apache.flink.table.functions.UserDefinedFunction.functionIdentifier(UserDefinedFunction.java:45) at org.apache.flink.table.planner.codegen.CodeGenUtils$.udfFieldName(CodeGenUtils.scala:715) at org.apache.flink.table.planner.codegen.CodeGeneratorContext.addReusableFunction(CodeGeneratorContext.scala:615) My udf as follows. public class UserTableFunction extends TableFunction<Row> { |
Hi Polarisary, The fields of your `UserTableFunction` maybe not serializable like `Connection` and `PreparedStatement`. So you can make them `transient` and let them not participate in the serialization. Hope this helps. Polarisary <[hidden email]> 于2019年12月26日周四 下午4:47写道:
Benchao Li School of Electronics Engineering and Computer Science, Peking University Tel:+86-15650713730 Email: [hidden email]; [hidden email] |
Free forum by Nabble | Edit this page |