|
1 |
| -# WIP: moving DTables out of Dagger |
2 |
| - |
3 |
| -test pr |
4 |
| - |
5 | 1 | # DTables
|
6 | 2 |
|
| 3 | +Distributed table structures and data manipulation operations built on top of [Dagger.jl](https://github.com/JuliaParallel/Dagger.jl) |
| 4 | + |
7 | 5 | [](https://juliaparallel.github.io/DTables.jl/stable/)
|
8 | 6 | [](https://juliaparallel.github.io/DTables.jl/dev/)
|
9 | 7 | [](https://github.com/juliaparallel/DTables.jl/actions/workflows/CI.yml?query=branch%3Amain)
|
10 | 8 | [](https://codecov.io/gh/juliaparallel/DTables.jl)
|
11 | 9 | [](https://github.com/invenia/BlueStyle)
|
| 10 | + |
| 11 | +# Usage |
| 12 | + |
| 13 | +Below you can find a quick example on how to get started with DTables. |
| 14 | + |
| 15 | +There's a lot more you can do though, so please refer to the documentation! |
| 16 | + |
| 17 | + |
| 18 | +```julia |
| 19 | +# launch a Julia session with threads/workers |
| 20 | + |
| 21 | +julia> using DTables |
| 22 | + |
| 23 | +julia> dt = DTable((a=rand(100), b=rand(100)), 10) |
| 24 | +DTable with 10 partitions |
| 25 | +Tabletype: NamedTuple |
| 26 | + |
| 27 | +julia> m = map(r -> (x=sum(r), id=Threads.threadid(),), dt) |
| 28 | +DTable with 10 partitions |
| 29 | +Tabletype: NamedTuple |
| 30 | + |
| 31 | +julia> xsum = reduce((x, y) -> x + y, m, init=0, cols=[:x]) |
| 32 | +EagerThunk (running) |
| 33 | + |
| 34 | +julia> threads_used = reduce((acc, el) -> union(acc, el), m, init=Set(), cols=[:id]) |
| 35 | +EagerThunk (running) |
| 36 | + |
| 37 | +julia> fetch(xsum) |
| 38 | +(x = 95.71209812014976,) |
| 39 | + |
| 40 | +julia> fetch(threads_used) |
| 41 | +(id = Set(Any[5, 4, 6, 13, 2, 10, 9, 12, 8, 3]),) |
| 42 | +``` |
0 commit comments