Skip to content

Question: using sedona-functions directly as UDFs in datafusion #552

@nevi-me

Description

@nevi-me

Hello

We have some hand-rolled geospatial functions in our codebase at work, we use datafusion as our execution engine with some custom data sources. The hand-rolled functions mimic PostGIS's ST_* functions, and we store geospatial data as BinaryArray that contains WKB types.

Question: do your UDFs only support SedonaType that's not SedonaType::Arrow(_)? I see that the UDF signatures require ArgMatcher::is_geometry() which isn't implemented for BinaryArray or BinaryViewArray.

Context

I tried replacing our functions with sedona-functions by registering all the exported functions as UDFs, however simple queries like:

select st_centroid(geom) from table;

fail with

Error performing query: "This feature is not implemented: st_centroid([Arrow(Binary)]): No kernel matching arguments"

For reference, the schema of the table looks something like:

+------------------------------------------+------------------------------------+----------+
| field name                               | type                               | nullable |
+------------------------------------------+------------------------------------+----------+
| id                                       | Int32                              | true     |
| name                                     | Utf8                               | true     |
| geom                                     | Binary                             | true     |
+------------------------------------------+------------------------------------+----------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions