Skip to content

Commit

Permalink
Add examples for reading delta table with Rust API. (#400)
Browse files Browse the repository at this point in the history
* Add examples for reading delta table with Rust API.
  • Loading branch information
zijie0 authored Aug 21, 2021
1 parent 842d526 commit 3f87e76
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
49 changes: 49 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ DeltaTable(./tests/data/delta-0.2.0)
files count: 3
```

### Examples

The examples folder shows how to use Rust API to manipulate Delta tables.

Examples can be run using the `cargo run --example` command. For example:

```bash
cargo run --example read_delta_table
```

Optional cargo package features
-----------------------

Expand Down
10 changes: 10 additions & 0 deletions rust/examples/read_delta_table.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extern crate anyhow;
extern crate deltalake;

#[tokio::main(flavor = "current_thread")]
async fn main() -> anyhow::Result<()> {
let table_path = "./tests/data/delta-0.8.0";
let table = deltalake::open_table(table_path).await?;
println!("{}", table);
Ok(())
}

0 comments on commit 3f87e76

Please sign in to comment.