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/add support for _varchar #487

Merged

Conversation

Jordan-M-Young
Copy link
Contributor

The goal of this PR is to solve the issue: Add support for _varchar #480. This issue centers around connectorx panicking when interacting with tables containing a varchar[] type.

To solve this, I added:

  • a VarcharArray type in the various enums in connectorx/src/sources/postgres/typesystem.rs
  • a Utf8Array type in the various enums in connectorx/src/destinations/arrow2/typesystem.rs
  • a mapping between VarcharArray and Utf8Array in connectorx/src/transports/postgres_arrow2.rs
  • implemented the ArrowAssoc traint for Option<Vec> and Vec in connectorx/src/destinations/arrow2/arrow_assoc.rs
  • added _varchar/varchar[] data to scripts/postgres.sql
  • added a test for _varchar/varchar[] compatibility with postgres/polars in connectorx/tests/test_polars.rs

Excited to hear feedback, make edits, and hopefully merge this PR into the project! This is my first ever OS contribution so I apologize for any rookie mistakes in advance!

@wangxiaoying
Copy link
Contributor

wangxiaoying commented Apr 14, 2023

Thanks @Jordan-M-Young for the PR! It looks good in general, and I left a minor comment. Also can you run cargo fmt to format the code in order to resolve the CI error?

@Jordan-M-Young
Copy link
Contributor Author

@wangxiaoying Thanks for taking a look at my PR! I just committed the requested edits (removing src/macro.rs changes and running cargo fmt)

Hopefully that will fix the CI pipeline! Looking forward to seeing this merged!!

@Jordan-M-Young
Copy link
Contributor Author

Hey @wangxiaoying I see that the testing stage of the CI pipelines failed on this latest check. I ran

cargo clean && just test locally and my test passes. I am using an updated version of the postgres.sql script to populate my dev postgres instance could that be the issue?

Have a nice weekend!

@wangxiaoying
Copy link
Contributor

wangxiaoying commented Apr 14, 2023

Hi @Jordan-M-Young , yeah I think that's probably the issue. We use postgres official docker hub image in our CI. You can use it to test locally and see whether your insert value sql can be run on it.

Have a nice weekend to you too : )

@Jordan-M-Young
Copy link
Contributor Author

Jordan-M-Young commented Apr 14, 2023

@wangxiaoying You were right, there was a typo in postgres.sql causing insert operation to fail. Hopefully its fixed now!

@wangxiaoying wangxiaoying merged commit d62e00f into sfu-db:main Apr 16, 2023
@wangxiaoying
Copy link
Contributor

Thank you @Jordan-M-Young !

@auyer
Copy link
Contributor

auyer commented Apr 17, 2023

This is really cool! Thanks @Jordan-M-Young !
@wangxiaoying , do you mind generating a new Release, or rc? 😄

@Jordan-M-Young
Copy link
Contributor Author

Thanks for your help with this @wangxiaoying ! Looking forward to contributing more in the future.

@Jordan-M-Young Jordan-M-Young deleted the feat/add-support-for-_varchar branch April 17, 2023 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants