Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Make DELETE operations return the number of deleted rows #1222

Closed
scottsand-db opened this issue Jun 22, 2022 · 4 comments
Closed
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@scottsand-db
Copy link
Collaborator

Feature request

Overview

Currently, the DELETE operation returns an empty result. It would be more useful if it returned the number of deleted rows.

Motivation

The number of deleted rows is an obvious metric that users would want from a delete operation.

Further details

Currently, DeleteCommand.scala is explicitly returning an empty DataFrame here. Instead, we could use the metrics member field to return the numDeletedRows.

Make sure to add tests, too :)

@scottsand-db scottsand-db added enhancement New feature or request good first issue Good for newcomers labels Jun 22, 2022
@AhmedEHaddad
Copy link

this has to be done in scala ?

@scottsand-db
Copy link
Collaborator Author

Hi @AhmedEHaddad - I believe so. Do you propose another way? Internally, regardless of SQL or DataFrame API, Delta Lake will eventually end up using DeleteCommand.scala to implement the delete operation.

@edmondop
Copy link
Contributor

@scottsand-db I had a look at the RunnableCommand and I hadn't grasped the meaning of the returned row. If I understood it correctly, this change should be sufficient.

edmondop@17998f4

I wanted to get feedback around the design before adding the tests, I hadn't opened a PR yet for this reason. It's my first contribution, so rather than implementing tests for the wrong thing, I wanted to double check if I understood the API

@scottsand-db
Copy link
Collaborator Author

@edmondo1984 i left some comments. Make some small changes then make the PR! I can help with ways to add tests, too. thanks for helping!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
4 participants