cyan-daimao commented on PR #26357:
URL: https://github.com/apache/flink/pull/26357#issuecomment-3708028524
"I encountered a similar error in an environment using Iceberg 1.10.1, Flink
2.1.1, and Java 21. The issue was resolved by implementing a custom serializer."
```java
StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();
try {
Class<?> icebergClass =
Class.forName("org.apache.iceberg.SerializableByteBufferMap");
ExecutionConfig config = env.getConfig();
SerializerConfigImpl serializerConfig = (SerializerConfigImpl)
config.getSerializerConfig();
serializerConfig.registerTypeWithKryoSerializer(
icebergClass,
new IcebergMapSerializer()
);
[IcebergInsertDemo.java](https://github.com/user-attachments/files/24421624/IcebergInsertDemo.java)
System.out.println("✅ 成功为
org.apache.iceberg.SerializableByteBufferMap 注册了自定义序列化器。");
[IcebergInsertDemo.java](https://github.com/user-attachments/files/24421627/IcebergInsertDemo.java)
} catch (ClassNotFoundException e) {
System.err.println("❌ 错误:找不到类
org.apache.iceberg.SerializableByteBufferMap。请检查您的 Iceberg 依赖版本是否正确。");
throw e;
}
// 3. 创建 TableEnvironment
StreamTableEnvironment tableEnv = StreamTableEnvironment.create(env);
```
[IcebergMapSerializer.java](https://github.com/user-attachments/files/24421625/IcebergMapSerializer.java)
[IcebergInsertDemo.java](https://github.com/user-attachments/files/24421629/IcebergInsertDemo.java)
more: https://juejin.cn/post/7591156262626132003
--
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]