hudi-rs icon indicating copy to clipboard operation
hudi-rs copied to clipboard

docs: add the examples crate for rust

Open gohalo opened this issue 1 year ago • 3 comments

Description

How are the changes test-covered

  • [x] N/A
  • [ ] Automated tests (unit and/or integration tests)
  • [ ] Manual tests
    • [ ] Details are described below

gohalo avatar Aug 30 '24 12:08 gohalo

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (main@f56603b). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #122   +/-   ##
=======================================
  Coverage        ?   87.60%           
=======================================
  Files           ?       14           
  Lines           ?      702           
  Branches        ?        0           
=======================================
  Hits            ?      615           
  Misses          ?       87           
  Partials        ?        0           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 30 '24 13:08 codecov[bot]

@gohalo thanks for raising this. While an "examples" crate can be helpful, we won't merge nice-to-have PRs until we can justify the value of the code. As of now, it's a simple example repeating the one on the readme. What other examples could we add there in future? How do we expect users to use and benefit from it? How can the example code be tested properly so we can easily evolve it? If we are to create a website, how can we consolidate the code here and the examples to show on website?

It's just a startup example for now. Recently, i'm trying to build a local minio env, and also working on create the table, support writing and so on. Maybe the examples will be a good startup for user and especilly for developer to run some basic example.

In short, I'm highlighting that we need to make a proper plan or design for any major addition to the codebase. You may want to create an issue for design, plan, and discussion first.

Just open an issue #123

gohalo avatar Aug 31 '24 01:08 gohalo

we should evolve the changes such that the examples are embedded in the rust module level docs and shown in docs.rs like https://docs.rs/pyo3/latest/pyo3/#example-using-python-from-rust this is more canonical way of showing examples, and automatically we'll get the example code tested by doc testing.

echoing the comment here https://github.com/apache/hudi-rs/issues/123#issuecomment-2411858426

xushiyan avatar Nov 30 '24 21:11 xushiyan

Thanks for the PR. While we're adding module level examples like https://github.com/apache/hudi-rs/blob/4176c2966ad3042aa4ca49dc5f231cf58a613d8f/crates/core/src/table/mod.rs#L24

we also have demo apps that ran as integ tests: https://github.com/apache/hudi-rs/tree/main/demo

closing this now.

xushiyan avatar Jun 02 '25 07:06 xushiyan