Skip to content

feat(c/sedona-geoarrow-c): support ST_AsText precision - #1448

Open
paleolimbot wants to merge 13 commits into
apache:mainfrom
paleolimbot:codex/st-astext-precision
Open

paleolimbot wants to merge 13 commits into
apache:mainfrom
paleolimbot:codex/st-astext-precision

Conversation

@paleolimbot

@paleolimbot paleolimbot commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Adds ST_AsText(geometry, max_decimal_digits) with scalar or per-row precision. Bundles geoarrow-c main (6e002d2), including case-insensitive WKT parsing. Uses visitor-based WKT reading and geometry-view WKT writing, with GEOS-style MULTIPOINT formatting. WKB constructors retain the existing Rust validation kernels and BinaryView output.

Most of the diff here is updating fast-float and geoarrow-c, which are vendored into the crates.

closes #1389

import sedona.db
sd = sedona.db.connect()
print(sd.sql("SELECT ST_AsText(ST_Point(1.123456789, 2.5), 6) AS wkt").to_pandas()["wkt"][0])
# POINT (1.123457 2.5)

This gives at 2-5x speedup on a few common WKT read/write operations.

Input Operation Rows/batch Previous Rust (ms) geoarrow-c (ms) Speedup
POINT Write 8,192 1.375 0.755 1.82×
POINT Read 8,192 1.347 0.505 2.66×
LINESTRING (10 coordinates) Write 8,192 12.294 5.042 2.44×
LINESTRING (10 coordinates) Read 8,192 11.471 2.924 3.92×
LINESTRING (100 coordinates) Write 8,192 129.156 59.483 2.17×
LINESTRING (100 coordinates) Read 8,192 97.148 24.123 4.03×
POLYGON (100 coordinates) Write 8,192 129.634 59.948 2.16×
POLYGON (100 coordinates) Read 8,192 97.692 24.609 3.97×
LINESTRING (10,000 coordinates) Write 64 86.856 45.851 1.89×
LINESTRING (10,000 coordinates) Read 64 75.620 17.924 4.22×
POINT (4,096 digits/ordinate) Read 1,024 13.050 3.595 3.63×

@paleolimbot
paleolimbot force-pushed the codex/st-astext-precision branch 2 times, most recently from a0f776a to 07cb875 Compare October 15, 2026 14:32
@paleolimbot
paleolimbot marked this pull request as ready for review November 16, 2026 15:03
Comment thread c/sedona-geoarrow-c/src/kernels.rs Resolved
paleolimbot added a commit to geoarrow/geoarrow-c that referenced this pull request Nov 23, 2026
…mensions (#203)

Fix three WKT parsing compatibility issues identified in
apache/sedona-db#1448: accept whitespace after the opening parenthesis
in flat MULTIPOINT, leading plus signs in coordinates, and attached Z,
M, and ZM dimension tags. Preserve case-insensitive keyword matching and
rejection of malformed signs and suffixes.

Add regression coverage for all geometry types, mixed-case tags, nested
collections, and malformed inputs. Validated all 906 tests with
fast_float enabled and disabled, including the fixture test run
separately with GEOARROW_TESTING_DIR set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ST_AsText: support an optional number of decimal digits

2 participants