Skip to content

Conversation

@erezrokah
Copy link
Member

Summary

Extracted from #11150 as MongoDB failed when trying to insert unit64 that overflows int64, see https://github.com/cloudquery/cloudquery/actions/runs/5176150331/jobs/9324604882#step:8:14.

The solution is to use a custom encoder to save the value as int64. When the value is read, if you cast it back to unit64 you'd get the original value, so there's no dataloss.

@erezrokah erezrokah requested review from a team, candiduslynx and disq and removed request for a team and candiduslynx June 5, 2023 16:20
@cq-bot cq-bot added the mongodb label Jun 5, 2023
@candiduslynx
Copy link
Contributor

It's strange to have the overflow as the value is 1, not -1 in tests, isn't it?

@erezrokah
Copy link
Member Author

It's strange to have the overflow as the value is 1, not -1 in tests, isn't it?

I'm not sure I follow. We try to insert an unit64 value of 14697929703826477056 in the tests. What do you mean by as the value is 1, not -1 in tests?

@candiduslynx
Copy link
Contributor

It's strange to have the overflow as the value is 1, not -1 in tests, isn't it?

I'm not sure I follow. We try to insert an unit64 value of 14697929703826477056 in the tests. What do you mean by as the value is 1, not -1 in tests?

Right, I think @hermanschaaf updated the code here since I last took a look at it.

@erezrokah erezrokah added the automerge Automatically merge once required checks pass label Jun 5, 2023
@kodiakhq kodiakhq bot merged commit a109638 into cloudquery:main Jun 5, 2023
kodiakhq bot pushed a commit that referenced this pull request Jun 6, 2023
🤖 I have created a release *beep* *boop*
---


## [2.1.1](plugins-destination-mongodb-v2.1.0...plugins-destination-mongodb-v2.1.1) (2023-06-06)


### Bug Fixes

* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 20b0de9 ([#11199](#11199)) ([dc3565d](dc3565d))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 88d5dc2 ([#11226](#11226)) ([9f306bc](9f306bc))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to a7aad4c ([#11184](#11184)) ([8a0822e](8a0822e))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to c67fb39 ([#11169](#11169)) ([dcb0f92](dcb0f92))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.0.9 ([#11240](#11240)) ([f92cd4b](f92cd4b))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v3 to v3.10.3 ([#11222](#11222)) ([a109638](a109638))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v3 to v3.10.4 ([#11244](#11244)) ([8fceef6](8fceef6))

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

3 participants