petern48 commented on PR #288:
URL: https://github.com/apache/sedona-db/pull/288#issuecomment-3507261421
Now our function exists, and the tests pass, but if you actually try it out,
you'll see that the function doesn't exist because it's not registered yet.
A convenient way we can try it out is to run SedonaDB's CLI:
```bash
# cd back to the root directory, since I'm still in `c/sedona-geos/src`
cd ../../..
# cd into the cli directory
cd sedona-cli
# Run the CLI
cargo run
```
Now I run the same query I did in PostGIS:
```sql
Sedona CLI v0.2.0
> SELECT ST_AsText(ST_Reverse(ST_GeomFromText('POLYGON ((2 2, 2 3, 3 3, 3 2,
2 2))')));
-- The output: This is a sign our function isn't registered.
Error during planning: Invalid function 'st_reverse'.
Did you mean 'list_reverse'?
```
Registering is simple, just import and add the function to the
[register.rs](https://github.com/apache/sedona-db/blob/94ce7db5287b39218b803eae057a4eb92a50c397/c/sedona-geos/src/register.rs#L4)
file in `c/sedona-geos/src/`. See the next commit. Afterwards, running the
query in the CLI works, and the warnings are gone. This is also needed for the
function to work in Python.
Small note: I've been getting small warnings about my code not being used
this whole time up until now (e.g see below). Registering the function fixes
this too.
<img width="352" height="66" alt="image"
src="https://github.com/user-attachments/assets/193dfd34-ce6c-4457-b110-62eabf7b21c2"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]