https://github.com/ignalina/alloy
Go to Rust calls with Apache Arrow datatype as parameter
https://github.com/ignalina/alloy
Last synced: about 1 year ago
JSON representation
Go to Rust calls with Apache Arrow datatype as parameter
- Host: GitHub
- URL: https://github.com/ignalina/alloy
- Owner: Ignalina
- License: mit
- Created: 2022-09-24T21:02:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-11T15:31:30.000Z (over 2 years ago)
- Last Synced: 2025-03-18T06:35:29.050Z (over 1 year ago)
- Language: C
- Size: 43.6 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README




Full design/build/deploy doc se [doc/README](doc/README.md)
An GO module allowing calls to Rust code code with Apache Arrow data. Operate in either one-shot mode or IPC streaming.
An example application in need of this is Thund , An Go/Rust based Apache Arrow centric DAG executor
Alloy means a mixture between two or more components and is a joint venture between Wilhelm Ågren (Rust) and Rickard Lundin(GO).
## Usage example
The example main.go should envision how your GO application utilize Alloy.
```golang
func main() {
mem := memory.NewGoAllocator()
var b api.Bridge
b = rust.Bridge{api.CommonParameter{mem}}
values := [][]int32{
{1, 2, 3, -4},
{2, 3, 4, 5},
{3, 4, 5, 6},
}
builders, arrays := buildAndAppend(mem, values)
ret, err := b.FromChunks(arrays)
if nil != err {
fmt.Println(err)
} else {
rust.Info(fmt.Sprintf("Rust counted %v arrays sent through ffi", ret))
}
}
```
Output, where default dummy Rust backend echoes out the sent data. It will be up to the Rust guys to implent code to process the data to their hearts content !!
```bash
$ ./alloy
[2022-10-17 18:09:34] [INFO] [Go] Exporting ArrowSchema and ArrowArray #1 to C
[2022-10-17 18:09:34] [INFO] [Go] Exporting ArrowSchema and ArrowArray #2 to C
[2022-10-17 18:09:34] [INFO] [Go] Exporting ArrowSchema and ArrowArray #3 to C
[2022-10-17 18:09:34] [INFO] [Go] Calling Rust through C rust now with 3 ArrowArrays
[2022-10-17 18:09:34] [INFO] [Rust] Hello! Reading the rust pointers now.
[2022-10-17 18:09:34] [INFO] [Rust] array1: Int32[1, 2, 3, -4]
[2022-10-17 18:09:34] [INFO] [Rust] array2: Int32[2, 3, 4, 5]
[2022-10-17 18:09:34] [INFO] [Rust] array3: Int32[3, 4, 5, 6]
[2022-10-17 18:09:34] [INFO] [Go] Hello, again! Successfully sent Arrow data to Rust.
[2022-10-17 18:09:34] [INFO] [Go] Rust counted 3 arrays sent through rust
```
## License
All code written is to be held under a general MIT-license, please see [LICENSE](https://github.com/Ignalina/alloy/blob/main/LICENSE) for specific information.