Skip to content

Conversation

@erezrokah
Copy link
Member

@erezrokah erezrokah commented Jun 22, 2023

Summary

Same as #11696

Fixes #11757

BEGIN_COMMIT_OVERRIDE
feat!: Upgrades the oracledb source plugin to use plugin-sdk v4. This version does not contain any user-facing breaking changes, but because it is now using CloudQuery gRPC protocol v3, it does require use of a destination plugin that also supports protocol v3. All recent destination plugin versions support this.
END_COMMIT_OVERRIDE

@erezrokah erezrokah requested review from a team and yevgenypats and removed request for a team June 22, 2023 12:57
sortResults(testTable, actualStrings)
sortResults(testTable, actualRecords)

for recordIndex, expectedRecord := range expectedRecords {
Copy link
Member Author

Choose a reason for hiding this comment

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

Notice we switched from string comparison to value comparison as everything is arrow types now

*arrow.Uint8Type, *arrow.Uint16Type, *arrow.Uint32Type, *arrow.Uint64Type:
return "NUMBER(38)"
case *arrow.Float16Type, *arrow.Float32Type, *arrow.Float64Type:
case *arrow.Float16Type, *arrow.Float32Type:
Copy link
Member Author

Choose a reason for hiding this comment

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

This code is only used in the tests.
Previously the OracleDB types were not accurate enough and data was lost during insert. It was not discovered in the tests, due to doing string comparison

return nil, err
}
return toTime(a.Value(i)), nil
t := toTime(a.Value(i))
Copy link
Member Author

Choose a reason for hiding this comment

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

@erezrokah
Copy link
Member Author

Marked this as blocked since it's missing the concurrency option

@erezrokah erezrokah force-pushed the fix/update_oracledb_source_sdk_v4 branch 4 times, most recently from 90f4982 to 9a1959f Compare June 26, 2023 13:45
@erezrokah erezrokah changed the title feat(oracledb): Update to SDK V4 feat(oracledb)!: Update to SDK V4 Jun 26, 2023
@erezrokah erezrokah force-pushed the fix/update_oracledb_source_sdk_v4 branch from 64d5544 to bd3930b Compare June 26, 2023 17:12
@erezrokah
Copy link
Member Author

Marked this as blocked since it's missing the concurrency option

#11766 should unblock this, but this update is still a breaking change

group, gctx := errgroup.WithContext(ctx)
group.SetLimit(int(c.Concurrency))
for _, table := range c.Tables {
if err := c.syncTable(gctx, table, res); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

We didn't really use the error group here 🤦

func (*Spec) SetDefaults() {
func (s *Spec) SetDefaults() {
if s.Concurrency == 0 {
s.Concurrency = 100
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a more sensible default than the SDK one

@erezrokah erezrokah force-pushed the fix/update_oracledb_source_sdk_v4 branch from bd3930b to 3e60164 Compare July 13, 2023 15:43
@erezrokah erezrokah force-pushed the fix/update_oracledb_source_sdk_v4 branch from 6691469 to 957e8df Compare July 13, 2023 16:02
@erezrokah erezrokah added automerge Automatically merge once required checks pass and removed automerge Automatically merge once required checks pass labels Jul 14, 2023
@erezrokah erezrokah added the automerge Automatically merge once required checks pass label Jul 14, 2023
@kodiakhq kodiakhq bot merged commit 5c0082d into cloudquery:main Jul 14, 2023
@erezrokah erezrokah deleted the fix/update_oracledb_source_sdk_v4 branch July 14, 2023 07:00
kodiakhq bot pushed a commit that referenced this pull request Jul 14, 2023

#### Summary

I missed this in #11711.
Without this fix we will always migrate all tables. The sync still works on the filtered tables, so this only impacts migration

<!--
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.

Migrate plugins/source/oracledb to github.com/cloudquery/plugin-sdk/v4

3 participants