Skip to content

Conversation

@erezrokah
Copy link
Member

@erezrokah erezrokah commented May 30, 2023

Closes #10760

BEGIN_COMMIT_OVERRIDE
feat: Update to use Apache Arrow type system (#11115)

BREAKING-CHANGE: This release introduces an internal change to our type system to use Apache Arrow. This should not have any visible breaking changes, however due to the size of the change we are introducing it under a major version bump to communicate that it might have some bugs that we weren't able to catch during our internal tests. If you encounter an issue during the upgrade, please submit a bug report. You will also need to update destinations depending on which one you use:

  • Azure Blob Storage >= v3.2.0
  • BigQuery >= v3.0.0
  • ClickHouse >= v3.1.1
  • DuckDB >= v1.1.6
  • Elasticsearch >= v2.0.0
  • File >= v3.2.0
  • Firehose >= v2.0.2
  • GCS >= v3.2.0
  • Gremlin >= v2.1.10
  • Kafka >= v3.0.1
  • Meilisearch >= v2.0.1
  • Microsoft SQL Server >= v4.2.0
  • MongoDB >= v2.0.1
  • MySQL >= v2.0.2
  • Neo4j >= v3.0.0
  • PostgreSQL >= v4.2.0
  • S3 >= v4.4.0
  • Snowflake >= v2.1.1
  • SQLite >= v2.2.0

END_COMMIT_OVERRIDE

}

func SchemaType(tableName string, columnName string, dataType string) schema.ValueType {
if strings.HasPrefix(columnName, "timestamp") {
Copy link
Member Author

Choose a reason for hiding this comment

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

There was a bug here actually. We should check dataType and not columnName.

Also we can remove the tableName and columnName arguments

@erezrokah erezrokah marked this pull request as ready for review May 30, 2023 16:40
@erezrokah erezrokah requested review from a team and hermanschaaf and removed request for a team May 30, 2023 16:40
@erezrokah erezrokah force-pushed the fix/update_oracledb_source_sdk_v3 branch from ebd9179 to 380cb29 Compare May 31, 2023 14:52
kodiakhq bot pushed a commit to cloudquery/plugin-sdk that referenced this pull request Jun 1, 2023

Follow up to #922 to handle nil `*[]byte]` in `uuid` and `binary`.
Also added some tests to floats I can extract to another PR.

This is required for supporting `nil` values in cloudquery/cloudquery#11115.
Discovered by generating test data with the [2 rows option](cloudquery/cloudquery#11115 (comment)) cc @candiduslynx.

---
kodiakhq bot pushed a commit to cloudquery/plugin-sdk that referenced this pull request Jun 1, 2023

Added due to cloudquery/cloudquery#11115, where I'm using decimal to represent all different int types.
For the tests of that PR I need to convert Go int types (generated by the test data) to scalars so I can compare with the data read from the database

---
kodiakhq bot pushed a commit to cloudquery/plugin-sdk that referenced this pull request Jun 1, 2023

Follow up to #937, also needed for cloudquery/cloudquery#11115

When reading data from a database it is common to pass a pointer to a value to support reading `nil` values, so the type of the value read is a pointer to a pointer.

Without this PR, if someone uses the decimal scalar they need to dereferences the pointer manually before setting the scalar value.

---
kodiakhq bot pushed a commit that referenced this pull request Jun 2, 2023
kodiakhq bot pushed a commit that referenced this pull request Jun 2, 2023
kodiakhq bot pushed a commit that referenced this pull request Jun 2, 2023
@erezrokah erezrokah force-pushed the fix/update_oracledb_source_sdk_v3 branch from 380cb29 to c9a80fd Compare June 2, 2023 13:59
@erezrokah erezrokah requested a review from candiduslynx June 2, 2023 14:00
@erezrokah erezrokah force-pushed the fix/update_oracledb_source_sdk_v3 branch 2 times, most recently from e2012c1 to 9dc8602 Compare June 2, 2023 14:07
Copy link
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.

just a couple of nits, LGTM

@erezrokah erezrokah force-pushed the fix/update_oracledb_source_sdk_v3 branch from b3a0403 to 506c3a1 Compare June 6, 2023 16:48
@erezrokah
Copy link
Member Author

This is on hold until for the same reason as #11212 (an issue with CQ internal columns in SDK v3)

@erezrokah erezrokah force-pushed the fix/update_oracledb_source_sdk_v3 branch 2 times, most recently from aa656dd to f352c8b Compare June 12, 2023 10:54
@erezrokah erezrokah force-pushed the fix/update_oracledb_source_sdk_v3 branch from f352c8b to 377e4ac Compare June 14, 2023 13:39
kodiakhq bot pushed a commit that referenced this pull request Jun 14, 2023

#### Summary

Fixes #11538. This is a breaking change since now if a `number` has precision it will create a float type column at the destination.

Parsing the precision and scale is take from https://github.com/cloudquery/cloudquery/pull/11115/files#diff-619acf691639d4d0288b58b3814d54d67a93f4774f22d61dc5812348ef099b4c and I'll port the query update from this PR to #11115


BEGIN_COMMIT_OVERRIDE
feat: Support number type with precision and scale
BREAKING-CHANGE: Support for parsing `number` type precision and scale was added. As a result number columns with scale that is different than `0`, e.g. `number(6,2)` will be converted to `float` type at the destination instead of `int`. You might need to either run with [forced migration mode](https://www.cloudquery.io/docs/reference/destination-spec#migrate_mode) or migrate the destination manually.

END_COMMIT_OVERRIDE

<!--
@erezrokah erezrokah force-pushed the fix/update_oracledb_source_sdk_v3 branch from 7873934 to b4b45c7 Compare June 21, 2023 12:14
@erezrokah
Copy link
Member Author

Going to merge this as #11214 (comment)

@erezrokah erezrokah added automerge Automatically merge once required checks pass and removed no automerge labels Jun 21, 2023
@kodiakhq kodiakhq bot merged commit 83832f3 into cloudquery:main Jun 21, 2023
@erezrokah erezrokah deleted the fix/update_oracledb_source_sdk_v3 branch June 21, 2023 13:00
kodiakhq bot pushed a commit that referenced this pull request Jul 14, 2023
🤖 I have created a release *beep* *boop*
---


## [3.0.0](plugins-source-oracledb-v2.0.0...plugins-source-oracledb-v3.0.0) (2023-07-14)


### ⚠ BREAKING CHANGES

* 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.
* This release introduces an internal change to our type system to use [Apache Arrow](https://arrow.apache.org/). This should not have any visible breaking changes, however due to the size of the change we are introducing it under a major version bump to communicate that it might have some bugs that we weren't able to catch during our internal tests. If you encounter an issue during the upgrade, please submit a [bug report](https://github.com/cloudquery/cloudquery/issues/new/choose). You will also need to update destinations depending on which one you use:
    - Azure Blob Storage >= v3.2.0
    - BigQuery >= v3.0.0
    - ClickHouse >= v3.1.1
    - DuckDB >= v1.1.6
    - Elasticsearch >= v2.0.0
    - File >= v3.2.0
    - Firehose >= v2.0.2
    - GCS >= v3.2.0
    - Gremlin >= v2.1.10
    - Kafka >= v3.0.1
    - Meilisearch >= v2.0.1
    - Microsoft SQL Server >= v4.2.0
    - MongoDB >= v2.0.1
    - MySQL >= v2.0.2
    - Neo4j >= v3.0.0
    - PostgreSQL >= v4.2.0
    - S3 >= v4.4.0
    - Snowflake >= v2.1.1
    - SQLite >= v2.2.0

### Features

* Update to use [Apache Arrow](https://arrow.apache.org/) type system ([#11115](#11115)) ([83832f3](83832f3))
* 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. ([5c0082d](5c0082d))


### Bug Fixes

* **deps:** Update github.com/apache/arrow/go/v13 digest to 5a06b2e ([#11857](#11857)) ([43c2f5f](43c2f5f))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 0656028 ([#11739](#11739)) ([7a6ad49](7a6ad49))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 0a52533 ([#12091](#12091)) ([927cefa](927cefa))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 1e68c51 ([#11637](#11637)) ([46043bc](46043bc))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 43638cb ([#11672](#11672)) ([3c60bbb](3c60bbb))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 4d76231 ([#11532](#11532)) ([6f04233](6f04233))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 8366a22 ([#11717](#11717)) ([8eeff5b](8eeff5b))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 95d3199 ([#11708](#11708)) ([03f214f](03f214f))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to a2a76eb ([#12104](#12104)) ([311f474](311f474))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to b0832be ([#11651](#11651)) ([71e8c29](71e8c29))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to d864719 ([#11611](#11611)) ([557a290](557a290))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to df3b664 ([#11882](#11882)) ([9635b22](9635b22))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to f060192 ([#11730](#11730)) ([c7019c2](c7019c2))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to f0dffc6 ([#11689](#11689)) ([18ac0e9](18ac0e9))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.1.0 ([#11665](#11665)) ([d8947c9](d8947c9))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.2.0 ([#11720](#11720)) ([7ef521d](7ef521d))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.2.1 ([#11722](#11722)) ([309be72](309be72))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.3.3 ([#11726](#11726)) ([f0ca611](f0ca611))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.3.4 ([#11753](#11753)) ([cd4fe1c](cd4fe1c))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.5.0 ([#11850](#11850)) ([3255857](3255857))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.6.0 ([#11916](#11916)) ([421e752](421e752))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.7.0 ([#12166](#12166)) ([94390dd](94390dd))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.1.0 ([#12174](#12174)) ([80f0289](80f0289))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.1.1 ([#12185](#12185)) ([cfaff16](cfaff16))

---
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/source/oracledb to github.com/cloudquery/plugin-sdk/v3

3 participants