Skip to content

SedonaFlink: add geography constructor functions (ST_Geog*) #3061

@jiayuasu

Description

@jiayuasu

Part of #3054.

Scope

Expose the geography constructor/conversion functions in SedonaFlink, registering them so they are callable from the Flink Table API / SQL — reaching parity with the 9 functions Spark exposes.

Depends on #3058 (GeographyTypeSerializer), now merged.

Functions

  • ST_GeogFromWKT (wkt, [srid])
  • ST_GeogFromText (wkt, [srid])
  • ST_GeogFromEWKT (ewkt)
  • ST_GeogCollFromText (wkt, [srid])
  • ST_GeogFromWKB (wkb, [srid])
  • ST_GeogFromEWKB (wkb)
  • ST_GeogFromGeoHash (geohash, [precision])
  • ST_GeogToGeometry (geography) → geometry
  • ST_GeomToGeography (geometry) → geography

Tasks

  • Add ScalarFunction wrappers in flink/src/main/java/org/apache/sedona/flink/expressions/GeographyConstructors.java, each delegating to org.apache.sedona.common.geography.Constructors with @DataTypeHint(value = "RAW", rawSerializer = GeographyTypeSerializer.class, bridgedTo = Geography.class), matching Spark's optional-argument defaults (srid 0, geohash precision null).
  • Register all 9 in flink/src/main/java/org/apache/sedona/flink/Catalog.java.
  • Add tests round-tripping each function through the Flink type system (GeographyConstructorTest).

Docs are tracked separately as the next sub-task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions