Skip to content

Example User Defined Function (UDF) for Seafowl in Rust which calculates the distance between (longitude, latitude) coordinate pairs.

License

Notifications You must be signed in to change notification settings

splitgraph/seafowl-udf-geo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

seafowl-udf-geo

Example WASM User Defined Function (UDF) for Seafowl in Rust.

For more information on Seafowl WASM support read this blog post.

A blogpost describing the project which uses this code can be found here.

To create your own Seafowl UDFs in Rust, fork this example repository.

Dependencies

First install Rust and Cargo, then install cargo-wasi by running:

cargo install cargo-wasi

Building the WASM module

cargo wasi build --release

Loading the WASM module into Seafowl as a UDF

This repository includes the create_udf.sh shell script which creates the Seafowl function wrapping the Rust WASM logic.

# Start seafowl
SEAFOWL__FRONTEND__HTTP__WRITE_ACCESS=any ./target/release/seafowl

# In another terminal tab/window, run
./create_udf.sh 

Invoking the newly created UDF:

./query_udf.sh

Running unit tests

cargo test

About

Example User Defined Function (UDF) for Seafowl in Rust which calculates the distance between (longitude, latitude) coordinate pairs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 89.0%
  • Shell 11.0%