zncleon opened a new issue, #14251:
URL: https://github.com/apache/iceberg/issues/14251
### Apache Iceberg version
main (development)
### Query engine
Flink
### Please describe the bug 🐞
We are using the `DynamicIcebergSink`, `DynamicRecordGenerator` to collect
`DynamicRecord`(composed by `GenericRowData`), and we set `upsert` mode. It
works correctly at the beginning, but after running for a time, the following
problems may occur. What is the cause of this problem?
**StackTrace:**
```
java.lang.ClassCastException: class org.apache.iceberg.GenericDataFile
cannot be cast to class org.apache.iceberg.DeleteFile
(org.apache.iceberg.GenericDataFile and org.apache.iceberg.DeleteFile are in
unnamed module of loader 'app')
at
org.apache.iceberg.util.ScanTaskUtil.contentSizeInBytes(ScanTaskUtil.java:34)
~[iceberg-flink-runtime-1.20-1.11.0-SNAPSHOT.jar:?]
at
org.apache.iceberg.SnapshotSummary$UpdateMetrics.addedFile(SnapshotSummary.java:292)
~[iceberg-flink-runtime-1.20-1.11.0-SNAPSHOT.jar:?]
at
org.apache.iceberg.SnapshotSummary$Builder.addedFile(SnapshotSummary.java:119)
~[iceberg-flink-runtime-1.20-1.11.0-SNAPSHOT.jar:?]
at
org.apache.iceberg.MergingSnapshotProducer.add(MergingSnapshotProducer.java:241)
~[iceberg-flink-runtime-1.20-1.11.0-SNAPSHOT.jar:?]
at org.apache.iceberg.BaseRowDelta.addRows(BaseRowDelta.java:60)
~[iceberg-flink-runtime-1.20-1.11.0-SNAPSHOT.jar:?]
at
java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
~[?:?]
at
java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
~[?:?]
at
org.apache.iceberg.flink.sink.dynamic.DynamicCommitter.commitDeltaTxn(DynamicCommitter.java:321)
~[iceberg-flink-runtime-1.20-1.11.0-SNAPSHOT.jar:?]
at
org.apache.iceberg.flink.sink.dynamic.DynamicCommitter.commitPendingResult(DynamicCommitter.java:258)
~[iceberg-flink-runtime-1.20-1.11.0-SNAPSHOT.jar:?]
at
org.apache.iceberg.flink.sink.dynamic.DynamicCommitter.commitPendingRequests(DynamicCommitter.java:224)
~[iceberg-flink-runtime-1.20-1.11.0-SNAPSHOT.jar:?]
at
org.apache.iceberg.flink.sink.dynamic.DynamicCommitter.commit(DynamicCommitter.java:152)
~[iceberg-flink-runtime-1.20-1.11.0-SNAPSHOT.jar:?]
at
org.apache.flink.streaming.runtime.operators.sink.committables.CheckpointCommittableManagerImpl.commit(CheckpointCommittableManagerImpl.java:151)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.streaming.runtime.operators.sink.CommitterOperator.commitAndEmit(CommitterOperator.java:175)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.streaming.runtime.operators.sink.CommitterOperator.commitAndEmitCheckpoints(CommitterOperator.java:168)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.streaming.runtime.operators.sink.CommitterOperator.initializeState(CommitterOperator.java:136)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.initializeOperatorState(StreamOperatorStateHandler.java:147)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.streaming.api.operators.AbstractStreamOperator.initializeState(AbstractStreamOperator.java:294)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.initializeStateAndOpenOperators(RegularOperatorChain.java:106)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.streaming.runtime.tasks.StreamTask.restoreStateAndGates(StreamTask.java:858)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$restoreInternal$5(StreamTask.java:812)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$1.call(StreamTaskActionExecutor.java:55)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.streaming.runtime.tasks.StreamTask.restoreInternal(StreamTask.java:812)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:771)
~[flink-dist-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:970)
~[flink-sql-jdbc-driver-bundle-1.20.2-mac.jar:1.20.2]
at
org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:939)
[flink-sql-jdbc-driver-bundle-1.20.2-mac.jar:1.20.2]
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:763)
[flink-sql-jdbc-driver-bundle-1.20.2-mac.jar:1.20.2]
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:575)
[flink-sql-jdbc-driver-bundle-1.20.2-mac.jar:1.20.2]
at java.lang.Thread.run(Thread.java:829) [?:?]
```
### Willingness to contribute
- [ ] I can contribute a fix for this bug independently
- [x] I would be willing to contribute a fix for this bug with guidance from
the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]