Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
rust:
strategy:
fail-fast: false
matrix:
example:
- sedonadb-rust
- sedonadb-rust-pointcloud

runs-on: ubuntu-latest
env:
Expand All @@ -66,17 +70,17 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
# Update this key to force a new cache
prefix-key: "rust-${{ matrix.name }}-v5"
prefix-key: "rust-${{ matrix.example }}-v5"

- name: Install dependencies
shell: bash
run: |
sudo apt-get update && sudo apt-get install -y libgeos-dev

- name: Build and run examples/sedonadb-rust
- name: Build and run examples/${{ matrix.example }}
shell: bash
run: |
cd examples/sedonadb-rust
cd examples/${{ matrix.example }}
# Use current PR/branch commit instead of main branch
if [ -n "${{ github.event.pull_request.head.sha }}" ]; then
REV="${{ github.event.pull_request.head.sha }}"
Expand All @@ -88,6 +92,3 @@ jobs:
sed -i "s|git = \"https://github.com/apache/sedona-db.git\"|git = \"https://github.com/${REPO}.git\", rev = \"${REV}\"|" Cargo.toml
cat Cargo.toml
cargo run

- name: Build and run examples/sedonadb-rust-pointcloud
run: cargo run -p sedonadb-rust-pointcloud-example
9 changes: 0 additions & 9 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ members = [
"rust/sedona-testing",
"rust/sedona",
"sedona-cli",
"examples/sedonadb-rust-pointcloud",
]
resolver = "2"

Expand Down
22 changes: 13 additions & 9 deletions examples/sedonadb-rust-pointcloud/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
[package]
name = "sedonadb-rust-pointcloud-example"
version = "0.0.1"
authors.workspace = true
license.workspace = true
description = "Apache SedonaDB Rust API Example"
edition.workspace = true
rust-version.workspace = true
publish = false
authors = ["Apache Sedona <dev@sedona.apache.org>"]
license = "Apache-2.0"
homepage = "https://github.com/apache/sedona-db"
repository = "https://github.com/apache/sedona-db"
description = "Apache SedonaDB Rust Point Cloud API Example"
readme = "README.md"
edition = "2021"
rust-version = "1.86"

[workspace]

[dependencies]
sedona = { workspace = true, features = ["pointcloud"] }
sedona-pointcloud = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread"]}
# We use a git dependency here so that we can test these examples
sedona = { git = "https://github.com/apache/sedona-db.git", package = "sedona", features = ["pointcloud"] }
tokio = { version = "1.44", features = ["rt-multi-thread"]}
2 changes: 1 addition & 1 deletion examples/sedonadb-rust-pointcloud/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use sedona::context::{SedonaContext, SedonaDataFrame};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ctx = SedonaContext::new_local_interactive().await?;
let url = "rust/sedona-pointcloud/tests/data/extra.laz";
let url = "../../rust/sedona-pointcloud/tests/data/extra.laz";
let df = ctx.sql(&format!("SELECT geometry FROM \"{url}\" ")).await?;
let output = df.show_sedona(&ctx, Some(5), Default::default()).await?;
println!("{output}");
Expand Down
4 changes: 2 additions & 2 deletions examples/sedonadb-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ rust-version = "1.86"

[dependencies]
datafusion = { version = "51.0.0"}
# When sedona is released on crates.io, this can be a version and not a git repo
sedona = { git = "https://github.com/apache/sedona-db.git", package = "sedona"}
# We use a git dependency here so that we can test these examples
sedona = { git = "https://github.com/apache/sedona-db.git", package = "sedona" }
tokio = { version = "1.44", features = ["rt-multi-thread"]}