Return number of deleted rows from Iceberg metadata delete#12136
Conversation
There was a problem hiding this comment.
When can the information be missing?
if it can actually be missing, we should return empty instead of 0,
but maybe it's guaranteed to exist and then we just should get and check?
There was a problem hiding this comment.
Are you sure? I actually think that it is better to return 0, it is more consistent for me when all deletes return information in the same way. Even tests show this as in current state this passes:
assertUpdate("DELETE FROM " + tableName + " WHERE key = 'three'", 0);
and it won't pass with the proposed change.
even this will fail:
assertQueryReturnsEmptyResult("DELETE FROM " + tableName + " WHERE key = 'three'");
with:
java.lang.AssertionError: [Rows for query [DELETE FROM test_delete_returns_number_of_rows_1npq8u144q WHERE key = 'three']] Expecting empty but was:<[[null]]>
@findepi WDYT?
There was a problem hiding this comment.
When can the information be missing?
When nothing is deleted this property is not set.
There was a problem hiding this comment.
information in the same way. Even tests show this as in current state this passes:
assertUpdate("DELETE FROM " + tableName + " WHERE key = 'three'", 0);
and it won't pass with the proposed change.
use assertUpdate("DELETE..."); (remove , 0) there
When nothing is deleted this property is not set.
Sounds like something that we should be possible to fix.
Until it's fixed, i don't want to rely on a quirk that lack of DELETED_RECORDS_PROP means "0 rows affected".
That sounds like relying on an impl detail.
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java
Outdated
Show resolved
Hide resolved
4583080 to
72e6d0d
Compare
|
Can you remove the two test overrides in BaseIcebergConnectorTest now? https://github.com/trinodb/trino/blob/master/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java#L242 |
72e6d0d to
423e446
Compare
There was a problem hiding this comment.
can we make Iceberg fill DELETED_RECORDS_PROP always?
let's file a PR and link with a TODO note here.
There was a problem hiding this comment.
can we make Iceberg fill DELETED_RECORDS_PROP always?
let's file a PR and link with a TODO note here.
There was a problem hiding this comment.
thanks for adding a TODO note. Can it contain a link?
There was a problem hiding this comment.
I don't have a pr yet. Should I open an issue? What if they decide to close it ?
There was a problem hiding this comment.
let's have an issue.
even if it gets closed, it will serve as an anchor for further information and current status
7b5578f to
bc55515
Compare
bc55515 to
728ffbc
Compare
|
CI #12151 |
Description
Related issues, pull requests, and links
fixes #12055
Documentation
( ) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
( ) Release notes entries required with the following suggested text: