Skip to content

Commit 5d92c66

Browse files
committed
temp
1 parent 97281f0 commit 5d92c66

16 files changed

Lines changed: 1900 additions & 31 deletions

File tree

Cargo.lock

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

ffi/src/expressions/engine_visitor.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,47 @@ fn visit_expression_scalar(
622622
}
623623
Scalar::Array(array) => visit_expression_array(visitor, array, sibling_list_id),
624624
Scalar::Map(map_data) => visit_expression_map(visitor, map_data, sibling_list_id),
625+
// v1: geo scalars are not exposed over FFI. There is no `visit_literal_geometry` /
626+
// `visit_literal_geography` callback in `EngineExpressionVisitor`, and no corresponding
627+
// `visit_expression_literal_geometry` / `_geography` FFI entry point exists in
628+
// `kernel_visitor.rs`, so engines cannot construct these variants from C. Hitting this
629+
// path means an expression containing a geo literal was built in Rust-only code and is
630+
// being walked across the FFI boundary -- the CRS information carried on the Scalar is
631+
// dropped here and a typed-null literal is substituted (using the Binary type tag, since
632+
// geo is WKB-encoded bytes at the FFI layer) so the sibling list stays well-formed.
633+
//
634+
// Upgrade path: add nullable
635+
// `visit_literal_geometry: Option<extern "C" fn(...)>` fields to
636+
// `EngineExpressionVisitor` and sibling `extern "C" fn visit_expression_literal_geometry`
637+
// kernel-side entries. Keep this arm as a fallback when the nullable field is None.
638+
Scalar::Geometry(_) => {
639+
tracing::error!(
640+
"FFI does not yet support Scalar::Geometry; routing to null literal. \
641+
Add visit_literal_geometry callbacks to support round-tripping CRS."
642+
);
643+
call!(
644+
visitor,
645+
visit_literal_null,
646+
sibling_list_id,
647+
NullTypeTag::Binary as u8,
648+
0,
649+
0
650+
)
651+
}
652+
Scalar::Geography(_) => {
653+
tracing::error!(
654+
"FFI does not yet support Scalar::Geography; routing to null literal. \
655+
Add visit_literal_geography callbacks to support round-tripping CRS."
656+
);
657+
call!(
658+
visitor,
659+
visit_literal_null,
660+
sibling_list_id,
661+
NullTypeTag::Binary as u8,
662+
0,
663+
0
664+
)
665+
}
625666
}
626667
}
627668

kernel/Cargo.toml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@ z85 = "3.0.6"
6060

6161
# optional deps
6262
futures = { version = "0.3", optional = true }
63+
# GeoArrow schema-only crate; provides geoarrow_schema::{Metadata, Crs, Edges, WkbType,
64+
# GeoArrowType} for type-safe Arrow extension metadata on geometry/geography columns in
65+
# arrow_conversion.rs. Pinned to 0.8 because geoarrow-schema 0.8 uses arrow-schema 58,
66+
# matching kernel's arrow_58 default dep.
67+
geoarrow-array = { version = "0.8", optional = true }
68+
geoarrow-expr-geo = { version = "0.8", optional = true }
69+
geoarrow-schema = { version = "0.8", optional = true }
70+
geo = { version = "0.32", optional = true }
71+
geo-traits = { version = "0.3", optional = true }
72+
wkb = { version = "0.9", optional = true }
73+
# WKT parser used by Scalar::geometry_from_wkt / geography_from_wkt. Already in Cargo.lock
74+
# transitively via geo-traits; promoting to an explicit dep keeps the version pinned.
75+
wkt = { version = "0.14", optional = true, default-features = false }
6376
# Used for fetching direct urls (like pre-signed urls). We disable `default-tls` to avoid
6477
# pulling in a second rustls crypto provider that conflicts with transitive deps (see
6578
# feature-tests for a regression test). Each default-engine-* feature selects its TLS backend.
@@ -112,7 +125,7 @@ need-arrow = [] # need-arrow is a marker that the feature needs arrow dep
112125

113126
arrow-57 = ["dep:arrow_57", "dep:parquet_57", "dep:object_store_12"]
114127
arrow-58 = ["dep:arrow_58", "dep:parquet_58", "dep:object_store_13"]
115-
arrow-conversion = ["need-arrow"]
128+
arrow-conversion = ["need-arrow", "dep:geoarrow-array", "dep:geoarrow-schema"]
116129
arrow-expression = ["need-arrow"]
117130

118131
# Schema diffing functionality (experimental)
@@ -126,6 +139,11 @@ default-engine-base = [
126139
"futures",
127140
"need-arrow",
128141
"tokio",
142+
"dep:geo",
143+
"dep:geo-traits",
144+
"dep:geoarrow-expr-geo",
145+
"dep:wkb",
146+
"dep:wkt",
129147
]
130148
# default-engine-native-tls enables reqwest with the native-tls backend. If you want to use
131149
# rustls instead, use 'default-engine-rustls' which has no native-tls dependency.

0 commit comments

Comments
 (0)