wuchong commented on code in PR #20211:
URL: https://github.com/apache/flink/pull/20211#discussion_r927497910
##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/functions/hive/HiveFunctionWrapper.java:
##########
@@ -127,13 +125,26 @@ public Class<UDFType> getUDFClass() throws
ClassNotFoundException {
* @return the UDF deserialized
*/
private UDFType deserializeUDF() {
- try {
- return (UDFType)
- SerializationUtilities.deserializeObject(
- udfSerializedString, (Class<Serializable>)
getUDFClass());
- } catch (ClassNotFoundException e) {
- throw new FlinkHiveUDFException(
- String.format("Failed to deserialize function %s.",
className), e);
- }
+ return (UDFType)
+ deserializeObjectFromKryo(udfSerializedBytes,
(Class<Serializable>) getUDFClass());
+ }
+
+ private static byte[] serializeObjectToKryo(Serializable object) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ Output output = new Output(baos);
+ Kryo kryo = new Kryo();
Review Comment:
Kryo construction is heavy, we can borrow Kryo from the Hive util.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]