Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(postgres): support loading tables with pgvector column types #9037

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

gforsyth
Copy link
Member

@gforsyth gforsyth commented Apr 22, 2024

Resolves #9025

We have had support for a bare vector type for a while, but pgvector defines
their vector type with precision, like vector(3) which was breaking our dtype
parsing.

I've opted to check here if the type starts with vector and treat all of those as dt.unknown.

For testing this, I've added pgvector to the postgres dockerfile -- if that's
too heavy, we can maybe mock up something in the postgres.sql file? But it
does compile reasonably quickly on my machine (~4 seconds).

FROM postgis/postgis:15-3.3-alpine
RUN apk add --no-cache postgresql15-plpython3
COPY --from=pgvector-builder /usr/local/lib/postgresql/bitcode/vector.index.bc /usr/local/lib/postgresql/bitcode/vector.index.bc
COPY --from=pgvector-builder /usr/local/lib/postgresql/vector.so /usr/local/lib/postgresql/vector.so
COPY --from=pgvector-builder /usr/local/share/postgresql/extension /usr/local/share/postgresql/extension
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fun 😒

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wild, right?

Copy link
Member

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cpcloud cpcloud added this to the 9.0 milestone Apr 25, 2024
@cpcloud cpcloud added bug Incorrect behavior inside of ibis datatypes Issues relating to ibis's datatypes (under `ibis.expr.datatypes`) sql Backends that generate SQL postgres The PostgreSQL backend labels Apr 25, 2024
@cpcloud
Copy link
Member

cpcloud commented Apr 25, 2024

Also, sorry you had to fix this again 😞

@cpcloud cpcloud added the feature Features or general enhancements label Apr 25, 2024
@cpcloud cpcloud merged commit 8846514 into ibis-project:main Apr 25, 2024
93 checks passed
@gforsyth gforsyth deleted the pgvector_type_support branch April 25, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis datatypes Issues relating to ibis's datatypes (under `ibis.expr.datatypes`) feature Features or general enhancements postgres The PostgreSQL backend sql Backends that generate SQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Support 'vector' datatype of pgvector
2 participants