duckdb / duckdb_vss

MIT License
98 stars 10 forks source link

[bug] load extension on duckdb 1.1.0 cause error #28

Closed Mrzyxing closed 2 months ago

Mrzyxing commented 2 months ago

I'm use duckdb with my python application, after auto package without specify the version of duckdb, so we got duckdb from version 1.0.0 to 1.1.0. And this sql may cause error:

>>> import duckdb
>>> mem_duck = duckdb.connect()
>>> mem_duck.sql("LOAD '/opt/data/duckdb/extensions/vss.duckdb_extension'")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
duckdb.duckdb.NotImplementedException: Not implemented Error: Enum value: '' not implemented
>>> mem_duck.sql("select version()")
┌─────────────┐
│ "version"() │
│   varchar   │
├─────────────┤
│ v1.1.0      │
└─────────────┘
carlopi commented 2 months ago

Hey @Mrzyxing, thanks for raising this!

I think what's happening here is that you are using an extension mean for DuckDB v1.0.0 while you are running DuckDB v1.1.0.

That, combined with a weird bug, lead to this not helpful error message. The bug is solved, to a degree, by this PR: https://github.com/duckdb/duckdb/pull/13884.

Workaround in your case is either let DuckDB install new extensions (say INSTALL vss; LOAD vss;) or downloading them yourself a new, from URL such as https://extensions.duckdb.org/v1.1.0/YOUR_PLATFORM/vss.duckdb_extension.gz, then performing gzip -d, then doing duckdb -c "LOAD 'vss.duckdb_extension';".

This should offer a workaround, to you or others that have bumped against some similar behaviour.

carlopi commented 2 months ago

This has been fixed by https://github.com/duckdb/duckdb/pull/13894 and to some degree by https://github.com/duckdb/duckdb/pull/13885.

Note that the original problem was that you were using incompatible versions of DuckDB library and extension, but this unclear error masked the proper one.