duckdb / duckdb_spatial

MIT License
493 stars 41 forks source link

Export duckdb table to gpkg format is throwing error duckdb version: 0.10.0 and python version: 3.12.2 in conda environment #283

Closed GuntuAshok closed 8 months ago

GuntuAshok commented 8 months ago

CatalogException Traceback (most recent call last) Cell In[9], line 1 ----> 1 con.sql("COPY stream TO 'streams.gpkg' WITH (FORMAT GDAL, DRIVER 'GPKG')")

CatalogException: Catalog Error: Copy Function with name gdal does not exist! Did you mean "csv"?

python version: 3.12.2 in conda environment duckdb version: 0.10.0 OS: Windows 11 I'm unable to install duckdb via conda-forge so installed duckdb via pip in my conda environment.

Maxxen commented 8 months ago

Hi! Thanks for reporting this issue. Have you made sure the spatial extension is installed and loaded?

GuntuAshok commented 8 months ago

yes I executed con.install_extension("spatial") con.load_extension("spatial")

Even my stream table has geometry column geom added so I guess that worked correctly. Even I installed GDAL also.

GuntuAshok commented 8 months ago

Tested the same database with duckdb CLI version 0.10.0 and this same command worked as expected. COPY stream TO 'streams.gpkg' WITH (FORMAT GDAL, DRIVER 'GPKG')

GuntuAshok commented 8 months ago

Okay I figured out what went wrong. Problem is with my code, and I sorted it out.