Skip to content

[GH-3202] Handle empty Geography inputs in ST_MakeLine - #3208

Merged
jiayuasu merged 1 commit into
apache:masterfrom
jiayuasu:fix/geography-make-line-empty
Jul 29, 2026
Merged

[GH-3202] Handle empty Geography inputs in ST_MakeLine#3208
jiayuasu merged 1 commit into
apache:masterfrom
jiayuasu:fix/geography-make-line-empty

Conversation

@jiayuasu

@jiayuasu jiayuasu commented Jul 29, 2026

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

Is this PR related to a ticket?

What changes were proposed in this PR?

  • Ignore empty Point, MultiPoint, and LineString components when assembling a Geography LineString.
  • Return LINESTRING EMPTY when neither input contributes a coordinate.
  • Duplicate the remaining coordinate when exactly one coordinate survives, producing a valid zero-length JTS/OGC LineString with the same point set.
  • Preserve the existing first-input SRID behavior.
  • Document the empty-input contract for Spark and Flink.

PostGIS and SedonaDB skip empty components but can represent or emit a one-coordinate LineString. JTS rejects that representation, so duplicating the sole coordinate is the valid-JTS adaptation.

How was this patch tested?

  • Common Geography function suite: 87 tests, 0 failures.
  • Spark Geography function suite: 55 tests, 0 failures.
  • Flink Geography function suite: 18 tests, 0 failures.
  • Coverage includes empty Point, MultiPoint, and LineString inputs, one surviving coordinate in either position, both inputs empty, WKB round trips, and first-input SRID preservation.
  • All cross-module tests used a task-isolated Maven repository to avoid SNAPSHOT artifact contamination.
  • Spotless, commit hooks, and diff checks passed.

Did this PR include necessary documentation updates?

  • Yes. The Spark and Flink Geography ST_MakeLine pages document how empty inputs and a single surviving coordinate are handled.

@jiayuasu
jiayuasu force-pushed the fix/geography-make-line-empty branch from 86441f6 to 4ba0aa9 Compare July 29, 2026 08:29
@jiayuasu jiayuasu added this to the sedona-1.9.1 milestone Jul 29, 2026
@jiayuasu
jiayuasu marked this pull request as ready for review July 29, 2026 20:01
@jiayuasu
jiayuasu merged commit b51e7d1 into apache:master Jul 29, 2026
44 of 50 checks passed
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.

[BUG]: Geography ST_MakeLine fails on empty inputs

1 participant