duckdb_spatial
duckdb_spatial copied to clipboard
Null needs to be cast to blob in ST_GeomFromWKB
SELECT ST_GeomFromWKB(NULL);
throws:
SQL Error: java.sql.SQLException: Binder Error: Could not choose a best candidate function for the function call "ST_GeomFromWKB("NULL")". In order to select one, please add explicit type casts.
Candidate functions:
ST_GeomFromWKB(BLOB) -> GEOMETRY
ST_GeomFromWKB(WKB_BLOB) -> GEOMETRY
Works when NULL is casted to blob:
SELECT ST_GeomFromWKB(NULL::blob);
This is expected, ST_GeomFromWKB is overloaded to work for both BLOB and WKB_BLOB, and a NULL literal has no type.
Seems to work differently in e.g. PostGIS where NULL w/o casting works.
This will be resolved in DuckDB v1.5