Skip to content

Commit e3b0100

Browse files
committed
first commit
0 parents  commit e3b0100

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.venv
2+
uv.lock
3+
4+
/site
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# delta-rs
2+
3+
This guide provides an introduction to using the Delta Lake Rust library (delta-rs).
4+
5+
## Install dependencies
6+
7+
```toml
8+
[dependencies]
9+
deltalake = { version = "0.22.3", features = ["s3"] }
10+
tokio = "1.42.0"
11+
```
12+
13+
## Create table
14+
15+
```rust
16+
use deltalake::kernel::DataType;
17+
use deltalake::operations::create::CreateBuilder;
18+
use std::collections::HashMap;
19+
20+
#[tokio::main()]
21+
async fn main() {
22+
// Register AWS S3 handlers for Delta Lake operations.
23+
deltalake::aws::register_handlers(None);
24+
25+
// Configure S3 storage parameters
26+
let mut storage_options = HashMap::new();
27+
storage_options.insert("AWS_ENDPOINT_URL".to_string(), "http://localhost:5561".to_string());
28+
storage_options.insert("AWS_REGION".to_string(), "us-east-1".to_string());
29+
storage_options.insert("AWS_ACCESS_KEY_ID".to_string(), "admin".to_string());
30+
storage_options.insert("AWS_SECRET_ACCESS_KEY".to_string(), "password".to_string());
31+
storage_options.insert("AWS_ALLOW_HTTP".to_string(), "true".to_string());
32+
storage_options.insert("AWS_S3_ALLOW_UNSAFE_RENAME".to_string(), "true".to_string());
33+
34+
// Create table
35+
CreateBuilder::new()
36+
.with_location("s3://data-lakehouse/".to_string())
37+
.with_storage_options(storage_options)
38+
.with_column("id", DataType::INTEGER, false, Default::default())
39+
.with_column("name", DataType::STRING, false, Default::default())
40+
.await
41+
.expect("Table creation failed");
42+
}
43+
44+
```

mkdocs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
site_name: My Second Brain
2+
site_url: https://tranet.app
3+
theme:
4+
name: material
5+
features:
6+
# code copy button
7+
- content.code.copy
8+
palette:
9+
- scheme: slate
10+
markdown_extensions:
11+
# code highlighting
12+
- pymdownx.highlight:
13+
anchor_linenums: true
14+
line_spans: __span
15+
pygments_lang_class: true
16+
- pymdownx.inlinehilite
17+
- pymdownx.snippets
18+
- pymdownx.superfences
19+
# permalinks
20+
- toc:
21+
permalink: true

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[project]
2+
name = "second_brain"
3+
version = "0.1.0"
4+
requires-python = "==3.13.*"
5+
dependencies = [
6+
"mkdocs-material>=9.5.49",
7+
]

0 commit comments

Comments
 (0)