Skip to content

Conversation

@erezrokah
Copy link
Member

Summary

Extracted from #8156.
For file destination we can only do force for every change (we might be able to do add and remove column safely for JSON as it's simply adding/removing a new field to the JSON object which should be fine. Out of scope for this PR).

@erezrokah erezrokah requested review from a team and hermanschaaf and removed request for a team February 20, 2023 14:59
@cq-bot cq-bot added the file label Feb 20, 2023
)

var migrateStrategy = destination.MigrateStrategy{
AddColumn: specs.MigrateModeForced,
Copy link
Member Author

@erezrokah erezrokah Feb 20, 2023

Choose a reason for hiding this comment

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

Add is forced mostly because of CSV as we also need to update the headers and enter empty values if we want to do this right (which we probably don't want to do now)

SkipOverwrite: true,
SkipDeleteStale: true,
SkipSecondAppend: true,
SkipMigrateAppend: true,
Copy link
Member

Choose a reason for hiding this comment

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

Parquet format doesn't support any changes or appends once the file footer is written.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK so the tests API is a bit confusing but this will be skipped actually since the migrate strategy is forced:
https://github.com/cloudquery/plugin-sdk/blob/fac9ed3681d4f10800274a6bd35d2fa9cdcc732d/plugins/destination/plugin_testing_migrate.go#L91

Once we add support for forced mode (which will probably just delete the existing file), we'll need to remove SkipMigrateAppendForce and then it will verify the forced append work 🙃

Copy link
Member Author

SkipMigrateAppend: true,
SkipMigrateOverwrite: true,
SkipMigrateOverwriteForce: true,
SkipMigrateAppendForce: true,
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 can remove SkipMigrateOverwriteForce and SkipMigrateAppendForce once we add support for forced mode, but out of scope for this PR

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


## [1.2.0](plugins-destination-file-v1.1.1...plugins-destination-file-v1.2.0) (2023-02-21)


### Features

* **deps:** Update File plugin-sdk to v1.38.2 ([#8262](#8262)) ([97c7b01](97c7b01))


### Bug Fixes

* **deps:** Update module github.com/cloudquery/filetypes to v1.4.2 ([#8218](#8218)) ([9e656c2](9e656c2))
* **deps:** Update module golang.org/x/net to v0.7.0 [SECURITY] ([#8176](#8176)) ([fc4cef8](fc4cef8))

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