You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Marwen94 (via GitHub)" <gi...@apache.org> on 2025/11/26 22:43:09 UTC
[I] Not able to use INSERT OVERWRITE in Flink 1.2 [iceberg]
Marwen94 opened a new issue, #14699:
URL: https://github.com/apache/iceberg/issues/14699
### Apache Iceberg version
1.9.0
### Query engine
Flink
### Please describe the bug 🐞
When trying to use INSERT OVERWRITE to an empty table I have this error:
```
Caused by: java.lang.IllegalStateException: Cannot overwrite partitions with delete files.
at org.apache.iceberg.relocated.com.google.common.base.Preconditions.checkState(Preconditions.java:513)
at org.apache.iceberg.flink.sink.IcebergFilesCommitter.replacePartitions(IcebergFilesCommitter.java:309)
at org.apache.iceberg.flink.sink.IcebergFilesCommitter.commitPendingResult(IcebergFilesCommitter.java:293)
at org.apache.iceberg.flink.sink.IcebergFilesCommitter.commitUpToCheckpoint(IcebergFilesCommitter.java:277)
at org.apache.iceberg.flink.sink.IcebergFilesCommitter.endInput(IcebergFilesCommitter.java:418)
at org.apache.flink.streaming.runtime.tasks.StreamOperatorWrapper.endOperatorInput(StreamOperatorWrapper.java:96)
at org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.endInput(RegularOperatorChain.java:97)
at org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:68)
at org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:638)
at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:231)
at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:973)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:917)
at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:970)
at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:949)
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:763)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:575)
at java.base/java.lang.Thread.run(Thread.java:840)
```
I tried to insert data to the table and then use overwrite as well but it did not work either.
Could you please check?
Thank you!
### 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: issues-unsubscribe@iceberg.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Not able to use INSERT OVERWRITE in Flink 1.2 [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on issue #14699:
URL: https://github.com/apache/iceberg/issues/14699#issuecomment-3585143090
Is Flink 1.2 a mistake?
What is your sink config? Are you mixing `overwriteMode=true` with equality fields? That will not work. See: https://iceberg.apache.org/docs/nightly/flink-writes/#upsert
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Not able to use INSERT OVERWRITE in Flink 1.20 [iceberg]
Posted by "Marwen94 (via GitHub)" <gi...@apache.org>.
Marwen94 commented on issue #14699:
URL: https://github.com/apache/iceberg/issues/14699#issuecomment-3586706999
@pvary,so I can overwrite a partition in a partitioned table but I can't overwrite all the partitions of the table at once? Am I understanding this correctly? Thanks
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Not able to use INSERT OVERWRITE in Flink 1.2 [iceberg]
Posted by "Marwen94 (via GitHub)" <gi...@apache.org>.
Marwen94 commented on issue #14699:
URL: https://github.com/apache/iceberg/issues/14699#issuecomment-3585647392
@pvary , yes Flink 1.20.0
Yes, I was mixing overwriteMode true with equality field indeed. Removing equality fields fixed the issue. This was not clear in the docs tbh.
So this means that it is not possible to do overwrite insert operation on partitioned table?
Thanks!
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Not able to use INSERT OVERWRITE in Flink 1.20 [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #14699: Not able to use INSERT OVERWRITE in Flink 1.20
URL: https://github.com/apache/iceberg/issues/14699
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Not able to use INSERT OVERWRITE in Flink 1.20 [iceberg]
Posted by "Marwen94 (via GitHub)" <gi...@apache.org>.
Marwen94 commented on issue #14699:
URL: https://github.com/apache/iceberg/issues/14699#issuecomment-3586733164
@pvary, to give you a bit of context of our use case: we want to create a partitioned iceberg table that we overwrite everyday. We want to avoid upsert operation to not handle deleted data between two runs.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Not able to use INSERT OVERWRITE in Flink 1.20 [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #14699:
URL: https://github.com/apache/iceberg/issues/14699#issuecomment-4550257182
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Not able to use INSERT OVERWRITE in Flink 1.2 [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on issue #14699:
URL: https://github.com/apache/iceberg/issues/14699#issuecomment-3586668173
From the docs:
> OVERWRITE and UPSERT modes are mutually exclusive and cannot be enabled at the same time. When using UPSERT mode with a partitioned table, source columns of corresponding partition fields must be included in the equality fields. For example, if the partition field is days(ts), then ts must be part of the equality fields.
OVERWRITE is overwriting a whole partition. It is for batch jobs only.
UPSERT is for updating the records one-by-one based on PK.
You should choose one of the ways for the updates
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Not able to use INSERT OVERWRITE in Flink 1.20 [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on issue #14699:
URL: https://github.com/apache/iceberg/issues/14699#issuecomment-3587257462
@Marwen94: You can't set the equality ids and the overwrite mode at the same sink - that is the issue you have seen.
If the overwrite mode is set to true, then it means that every partition which is changed is overwritten with the new data - every old data file is removed, and the new data files are inserted. Still, the unmodified partitions are not dropped.
If the equality ids are set, then the old data is retained, and only the rows are updated. So the records are kept and if the same row (based on the equality columns) is arrived then the old row is removed, and the new row is inserted.
Reading this page could help: https://iceberg.apache.org/docs/nightly/flink-writes/
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Not able to use INSERT OVERWRITE in Flink 1.20 [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #14699:
URL: https://github.com/apache/iceberg/issues/14699#issuecomment-4665448992
This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org