You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2023/01/17 09:08:15 UTC

[GitHub] [hudi] hangc0276 opened a new issue, #7686: [SUPPORT] Is there any way to delete records by specify one field value without selecting all the records out

hangc0276 opened a new issue, #7686:
URL: https://github.com/apache/hudi/issues/7686

   **_Tips before filing an issue_**
   
   - Have you gone through our [FAQs](https://hudi.apache.org/learn/faq/)?
   
   - Join the mailing list to engage in conversations and get faster support at dev-subscribe@hudi.apache.org.
   
   - If you have triaged this as a bug, then file an [issue](https://issues.apache.org/jira/projects/HUDI/issues) directly.
   
   **Describe the problem you faced**
   For a hudi table, I specify the rowKey with multiple fields, such as `<ledgerId, entryId>`. When deleting records, I wonder that is there any way to delete all the records by specifying one rowKey filed, such as `ledgerId`. 
   
   For example, there are 10 records in the Hudi table.
   | ledgerId | entryId | value |
   | --- | --- | --- | 
   | 1 | 1 | 10 |
   | 1 | 2 | 20 |
   | 1 | 3 | 30 |
   | 1 | 4 | 40 |
   | 1 | 5 | 50 |
   | 2 | 1 | 60 |
   | 2 | 2 | 70 |
   | 2 | 3 | 80 |
   | 2 | 4 | 90 |
   | 2 | 5 | 100 |
   
   When I set delete HoodieKey with the ledgerId field `ledgerId:1`, I wonder whether hoodie can delete all the rows with `ledgerId = 1`
   


-- 
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: commits-unsubscribe@hudi.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] danny0405 commented on issue #7686: [SUPPORT] Is there any way to delete records by specify one field value without selecting all the records out

Posted by GitBox <gi...@apache.org>.
danny0405 commented on issue #7686:
URL: https://github.com/apache/hudi/issues/7686#issuecomment-1386504650

   One workaround is insert into one record with the desired primary key and define your payload class as a delete payload, but yeah, I agree Iceberg has better definition and operability for APIs. Would create a JIRA to support this.
   
   See https://issues.apache.org/jira/browse/HUDI-5573


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hangc0276 commented on issue #7686: [SUPPORT] Is there any way to delete records by specify one field value without selecting all the records out

Posted by GitBox <gi...@apache.org>.
hangc0276 commented on issue #7686:
URL: https://github.com/apache/hudi/issues/7686#issuecomment-1385476397

   `Iceberg` supports deleteFromRowFilter, and we provide an expressions filter to delete all the matched records.
   ```java
   table.newDelete()
            .deleteFromRowFilter(Expressions.equal("ledgerId", "1")))
            .commit();
   ```
   If Hudi can provide the same filter for deletion, it will be greatly helpful for developers.


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] nfarah86 commented on issue #7686: [SUPPORT] Is there any way to delete records by specify one field value without selecting all the records out

Posted by "nfarah86 (via GitHub)" <gi...@apache.org>.
nfarah86 commented on issue #7686:
URL: https://github.com/apache/hudi/issues/7686#issuecomment-1398839615

   You can look up the key by querying it in hudi. Your query can search through a prefix. From there, you can delete the record. 


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] danny0405 closed issue #7686: [SUPPORT] Is there any way to delete records by specify one field value without selecting all the records out

Posted by GitBox <gi...@apache.org>.
danny0405 closed issue #7686: [SUPPORT] Is there any way to delete records by specify one field value without selecting all the records out
URL: https://github.com/apache/hudi/issues/7686


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org