Skip to content

feat(postgresql): Update PG to SDK V3 native arrow support#10783

Merged
yevgenypats merged 18 commits intomainfrom
feat/pg_sdk_v3_arrow
May 18, 2023
Merged

feat(postgresql): Update PG to SDK V3 native arrow support#10783
yevgenypats merged 18 commits intomainfrom
feat/pg_sdk_v3_arrow

Conversation

@yevgenypats
Copy link
Copy Markdown
Contributor

@yevgenypats yevgenypats commented May 14, 2023

Closes #10727

@yevgenypats yevgenypats requested a review from hermanschaaf May 14, 2023 16:45
@yevgenypats yevgenypats force-pushed the feat/pg_sdk_v3_arrow branch from ce950e4 to c7a2d12 Compare May 15, 2023 14:13
kodiakhq bot pushed a commit to cloudquery/plugin-sdk that referenced this pull request May 15, 2023
Few notes:

- Most of the code here was removed in #854 to prevent accidental use before it was ready
- Sources moved to use the new `schema.Table` which means use of `arrow.DataType` instead of our old `ValueType`
- Protocol in sources and destinations are upgraded to use native arrow format (sources v2 and dest v1) - https://github.com/cloudquery/plugin-pb-go
- Introduces a new `scalar` package which is mostly used by our "managed" sources and basically our old cqtypes just now using arrow types (which also support nesting). This will hopefully go upstream one day but I don't think we should block on that as the upstream package is not a fit right now and will take time for such refactor to make it upstream. 

Follow-up PRs with example sources and dest will follow soon.

IMPORTANT: all destinations should be released first as we decided new sources will work only with new destination to avoid un-necessary backward compatibility maintenance.  

Example PRs:
- PostgreSQL: cloudquery/cloudquery#10783
- GCP: cloudquery/cloudquery#10784
- CLI: cloudquery/cloudquery#10785
@yevgenypats yevgenypats force-pushed the feat/pg_sdk_v3_arrow branch from 363aad2 to 7d07366 Compare May 15, 2023 22:05
Copy link
Copy Markdown
Contributor

@hermanschaaf hermanschaaf left a comment

Choose a reason for hiding this comment

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

Looks good! Few final comments about uint handling

@yevgenypats yevgenypats added the automerge Automatically merge once required checks pass label May 17, 2023
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
b.Append(val.([]byte))
case *array.TimestampBuilder:
b.Append(arrow.Timestamp(val.(time.Time).UnixMicro()))
switch b.Type().(*arrow.TimestampType).Unit {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as in snowflake PR (use single func instead of own impl)

Co-authored-by: Alex Shcherbakov <candiduslynx@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@candiduslynx candiduslynx left a comment

Choose a reason for hiding this comment

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

I'd like to address this comment before merging, the proposed solution is the same as here

@yevgenypats yevgenypats merged commit d242030 into main May 18, 2023
@yevgenypats yevgenypats deleted the feat/pg_sdk_v3_arrow branch May 18, 2023 06:37
kodiakhq bot pushed a commit that referenced this pull request May 18, 2023
🤖 I have created a release *beep* *boop*
---


## [4.1.0](plugins-destination-postgresql-v4.0.5...plugins-destination-postgresql-v4.1.0) (2023-05-18)


### Features

* **deps:** Upgrade to Apache Arrow v13 (latest `cqmain`) ([#10605](#10605)) ([a55da3d](a55da3d))
* **postgresql:** Update PG to SDK V3 native arrow support ([#10783](#10783)) ([d242030](d242030))


### Bug Fixes

* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.0.8 ([#10798](#10798)) ([27ff430](27ff430))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Migrate plugin/destination/postgresql to github.com/cloudquery/plugin-sdk/v3

4 participants