Skip to content

Commit 1667b98

Browse files
committed
Now everything compiles, but some tests are failing
1 parent 124007c commit 1667b98

File tree

29 files changed

+1459
-145
lines changed

29 files changed

+1459
-145
lines changed

Cargo.lock

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ rust-version = "1.82"
5858
approx = "0.5"
5959
abi_stable = "0.11.3"
6060
adbc_core = "0.20.0"
61+
adbc_ffi = "0.20.0"
6162
lru = "0.12"
6263
arrow = { version = "55.1.0", features = ["prettyprint", "ffi", "chrono-tz"] }
6364
arrow-array = { version = "55.1.0" }
@@ -129,6 +130,7 @@ datafusion-ffi = { git = "https://github.com/paleolimbot/datafusion.git", branch
129130
datafusion-physical-expr = { git = "https://github.com/paleolimbot/datafusion.git", branch = "local-49-with-patch", package = "datafusion-physical-expr" }
130131
datafusion-physical-plan = { git = "https://github.com/paleolimbot/datafusion.git", branch = "local-49-with-patch", package = "datafusion-physical-plan" }
131132

132-
# geo-index = { git = "https://github.com/Kontinuation/geo-index.git", branch = "geo-0.31.0" }
133-
geo-index = { path = "/Users/bopeng/workspace/github/geo-index" }
134-
wkb = { path = "/Users/bopeng/workspace/github/wkb.worktrees/main" }
133+
geo-index = { git = "https://github.com/Kontinuation/geo-index.git", branch = "geo-0.31.0" }
134+
# geo-index = { path = "/Users/bopeng/workspace/github/geo-index" }
135+
wkb = { git = "https://github.com/Kontinuation/wkb", branch = "expose-more-apis" }
136+
# wkb = { path = "/Users/bopeng/workspace/github/wkb.worktrees/main" }

c/sedona-geos/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ criterion = { workspace = true }
3131
sedona = { path = "../../rust/sedona" }
3232
sedona-testing = { path = "../../rust/sedona-testing", features = ["criterion"] }
3333
rstest = { workspace = true }
34+
geo = { workspace = true }
3435

3536
[dependencies]
3637
arrow-schema = { workspace = true }
@@ -49,3 +50,7 @@ byteorder = { workspace = true }
4950
[[bench]]
5051
harness = false
5152
name = "geos-functions"
53+
54+
[[bench]]
55+
harness = false
56+
name = "wkb_to_geos"
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
use criterion::{criterion_group, criterion_main};
2+
use geo::{LineString, Point};
3+
use sedona_geos::wkb_to_geos::GEOSWkbFactory;
4+
use wkb::Endianness;
5+
6+
fn generate_wkb_linestring(num_points: usize, endianness: Endianness) -> Vec<u8> {
7+
let mut points = Vec::new();
8+
for i in 0..num_points {
9+
points.push(Point::new(i as f64, i as f64));
10+
}
11+
let linestring = LineString::from(points);
12+
let mut buffer = Vec::new();
13+
wkb::writer::write_geometry(
14+
&mut buffer,
15+
&linestring,
16+
&wkb::writer::WriteOptions { endianness },
17+
)
18+
.unwrap();
19+
buffer
20+
}
21+
22+
fn bench_parse(c: &mut criterion::Criterion) {
23+
for num_points in [4, 10, 100, 500, 1000] {
24+
for endianness in [Endianness::BigEndian, Endianness::LittleEndian] {
25+
let wkb_buf = generate_wkb_linestring(num_points, endianness);
26+
let wkb = wkb::reader::read_wkb(&wkb_buf).unwrap();
27+
let endianness_name: &str = match endianness {
28+
Endianness::BigEndian => "big endian",
29+
Endianness::LittleEndian => "little endian",
30+
};
31+
32+
c.bench_function(
33+
&format!(
34+
"convert linestring containing {num_points} points using to_geos ({endianness_name})"
35+
),
36+
|b| {
37+
let factory = GEOSWkbFactory::new();
38+
b.iter(|| {
39+
let g = factory.create(&wkb).unwrap();
40+
criterion::black_box(g);
41+
});
42+
},
43+
);
44+
45+
c.bench_function(
46+
&format!(
47+
"convert linestring containing {num_points} points using geos wkb parser ({endianness_name})"
48+
),
49+
|b| {
50+
b.iter(|| {
51+
let g = geos::Geometry::new_from_wkb(wkb.buf()).unwrap();
52+
criterion::black_box(g);
53+
});
54+
},
55+
);
56+
}
57+
}
58+
}
59+
60+
criterion_group!(benches, bench_parse);
61+
criterion_main!(benches);

0 commit comments

Comments
 (0)