Skip to content

Commit 68b8cd8

Browse files
committed
fix
1 parent 14a713c commit 68b8cd8

4 files changed

Lines changed: 7 additions & 28 deletions

File tree

ffi/src/expressions/kernel_visitor.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -500,15 +500,8 @@ impl NullTypeTag {
500500
PrimitiveType::Timestamp => (Self::Timestamp, 0, 0),
501501
PrimitiveType::TimestampNtz => (Self::TimestampNtz, 0, 0),
502502
PrimitiveType::Decimal(dt) => (Self::Decimal, dt.precision(), dt.scale()),
503-
// Geometry/Geography carry an SRID string (and for Geography, an edge
504-
// algorithm) that cannot fit in the (tag, u8, u8) payload this function
505-
// returns. We route them through NullTypeTag::Binary to stay consistent
506-
// with the FFI schema visitor (which routes geo columns through
507-
// visit_binary): consumers see a uniformly binary view of geo across
508-
// schema and expressions in this PR. CRS is lost at the FFI boundary
509-
// either way -- there is no side channel for it here. Once real FFI geo
510-
// support lands, new NullTypeTag::Geometry / ::Geography variants will
511-
// replace this arm.
503+
// TODO: Once real FFI geo support lands, new NullTypeTag::Geometry / ::Geography variants
504+
// willreplace this arm.
512505
PrimitiveType::Geometry(_) | PrimitiveType::Geography(_) => (Self::Binary, 0, 0),
513506
},
514507
_ => (Self::NonPrimitive, 0, 0),

ffi/src/schema.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -330,17 +330,8 @@ fn visit_schema_impl(schema: &StructType, visitor: &mut EngineSchemaVisitor) ->
330330
&DataType::DATE => call!(visit_date),
331331
&DataType::TIMESTAMP => call!(visit_timestamp),
332332
&DataType::TIMESTAMP_NTZ => call!(visit_timestamp_ntz),
333-
// Geometry/Geography are WKB-encoded bytes at the FFI layer -- route through
334-
// visit_binary. The SRID (and edge algorithm for Geography) carried on the
335-
// kernel PrimitiveType is not surfaced through this visitor; FFI consumers see
336-
// only a binary column. The companion null-literal path in
337-
// ffi/src/expressions/kernel_visitor.rs emits NullTypeTag::Binary for the same
338-
// reason, giving consumers a uniformly binary view across schema and
339-
// expressions. This is a pragmatic stub, not a claim that geo is semantically
340-
// equivalent to binary -- CRS-aware operations against these columns will
341-
// produce meaningless results. Tables with geo columns should not be consumed
342-
// through this FFI until dedicated visit_geometry / visit_geography callbacks
343-
// carrying the SRID are added.
333+
// Geometry/Geography are WKB-encoded bytes at the FFI layer
334+
// TODO: Add visit_geometry / visit_geography callbacks carrying the SRID once real FFI geo support lands
344335
DataType::Primitive(PrimitiveType::Geometry(_))
345336
| DataType::Primitive(PrimitiveType::Geography(_)) => call!(visit_binary),
346337
}

kernel/src/engine/arrow_conversion/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,9 @@ impl TryFromKernel<&DataType> for ArrowDataType {
176176
PrimitiveType::TimestampNtz => {
177177
Ok(ArrowDataType::Timestamp(TimeUnit::Microsecond, None))
178178
}
179-
// Geometry/Geography are WKB-encoded bytes at the Arrow layer. The SRID
180-
// (and edge algorithm for Geography) belongs on the ArrowField as
181-
// GeoArrow extension metadata (the `crs` / `edges` keys), not on the
182-
// ArrowDataType itself. Attaching that metadata is deferred to the
183-
// StructField -> ArrowField conversion path.
179+
// Geometry/Geography are WKB-encoded bytes.
180+
// The SRID (and edge algorithm for Geometry) belongs on the ArrowField
181+
// as GeoArrow extension metadata
184182
PrimitiveType::Geometry(_) | PrimitiveType::Geography(_) => {
185183
Ok(ArrowDataType::Binary)
186184
}

kernel/src/engine/arrow_expression/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,6 @@ impl Scalar {
213213
"Variant is not supported as scalar yet.",
214214
));
215215
}
216-
// Geometry/Geography are WKB-encoded bytes at the Arrow layer, so null appends
217-
// route through the BinaryBuilder path. GeoArrow extension metadata is attached
218-
// at the ArrowField level (in a schema), not to the builder produced here.
219216
DataType::Primitive(PrimitiveType::Geometry(_) | PrimitiveType::Geography(_)) => {
220217
append_nulls_as!(array::BinaryBuilder)
221218
}

0 commit comments

Comments
 (0)