Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

☝🏼Destinations supports destination sync mode #2460

Merged
merged 12 commits into from
Mar 26, 2021

Conversation

ChristopheDuong
Copy link
Contributor

@ChristopheDuong ChristopheDuong commented Mar 15, 2021

What

Describe what the change is solving
Closes #2409

Pre-merge Checklist

  • Run integration tests
  • Publish Docker images

@ChristopheDuong ChristopheDuong changed the title Chris/dedup destination Destinations supports destination sync mode Mar 15, 2021
Copy link
Contributor

@cgardens cgardens 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!

i think we need to make sure we write integrations tests for normalization so that we all be in agreement on what exactly the behavior is we expect. this shouldn't be part of the PR, but i'm just pointing it out so it doesn't get forgotten.

LOGGER.info("configured destination sync modes: {}", syncInput.getCatalog().getStreams()
.stream()
.collect(Collectors.toMap(s -> s.getStream().getName(),
s -> s.getDestinationSyncMode() != null ? s.getDestinationSyncMode() : DestinationSyncMode.APPEND)));
Copy link
Contributor

Choose a reason for hiding this comment

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

is this assumption safe? it seems like if syncMode is full_refresh and destinationSyncMode is null then we'll end up with destinationSyncMode being set to append. In the case i think the intended configuration is full refresh, but we'll end up with incremental. it seems like for now if destinationSyncMode is empty you need to set using information from sync mode to figure out what it should be? i could be misunderstanding.

maybe you could write a test that shows the mapping of the possible configurations to what you expect them to be so that we can all be on the same page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed offline and agreed on moving forward with 2 changes:

  1. we'll be removing the default values of sync modes and raising exceptions if they are not defined...
  2. I will be providing a Migration Script to make sure destination sync modes are defined when upgrading versions and are keeping the same behavior as before the upgrade

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since they become required I'll start another PR for that change instead.
In the meantime, I can merge this one as it is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is here: #2500

@@ -124,7 +125,7 @@ public long createGetSpecJob(String integrationImage) throws IOException {
}

// Strategy:
// 1. Set all streams to full refresh.
// 1. Set all streams to full refresh - overwrite.
// 2. Create a job where the source emits no records.
// 3. Run a sync from the empty source to the destination. This will overwrite all data for each
// stream in the destination.
Copy link
Contributor Author

@ChristopheDuong ChristopheDuong Mar 16, 2021

Choose a reason for hiding this comment

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

Instead of an empty source, could we force a full refresh from source instead?
Talking with @johnlafleur, we feel it would be friendlier to the user and so I created this ticket: #2484

@ChristopheDuong
Copy link
Contributor Author

ChristopheDuong commented Mar 16, 2021

/publish connector=connectors/destination-postgres

🕑 connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/657770534
✅ connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/657770534

@ChristopheDuong
Copy link
Contributor Author

ChristopheDuong commented Mar 16, 2021

/publish connector=connectors/destination-bigquery

🕑 connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/657891412
❌ connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/657891412

@ChristopheDuong
Copy link
Contributor Author

ChristopheDuong commented Mar 16, 2021

/publish connector=connectors/destination-snowflake

🕑 connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/657891631
✅ connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/657891631

@ChristopheDuong
Copy link
Contributor Author

ChristopheDuong commented Mar 16, 2021

/publish connector=connectors/destination-redshift

🕑 connectors/destination-redshift https://github.com/airbytehq/airbyte/actions/runs/657891996
✅ connectors/destination-redshift https://github.com/airbytehq/airbyte/actions/runs/657891996

@ChristopheDuong
Copy link
Contributor Author

ChristopheDuong commented Mar 16, 2021

/publish connector=connectors/destination-csv

🕑 connectors/destination-csv https://github.com/airbytehq/airbyte/actions/runs/657892170
✅ connectors/destination-csv https://github.com/airbytehq/airbyte/actions/runs/657892170

@ChristopheDuong
Copy link
Contributor Author

ChristopheDuong commented Mar 16, 2021

/publish connector=connectors/destination-local-json

🕑 connectors/destination-local-json https://github.com/airbytehq/airbyte/actions/runs/657904892
✅ connectors/destination-local-json https://github.com/airbytehq/airbyte/actions/runs/657904892

@ChristopheDuong
Copy link
Contributor Author

ChristopheDuong commented Mar 16, 2021

/publish connector=connectors/destination-meilisearch

🕑 connectors/destination-meilisearch https://github.com/airbytehq/airbyte/actions/runs/657893499
✅ connectors/destination-meilisearch https://github.com/airbytehq/airbyte/actions/runs/657893499

@ChristopheDuong
Copy link
Contributor Author

ChristopheDuong commented Mar 16, 2021

/publish connector=connectors/destination-bigquery

🕑 connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/658114832
❌ connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/658114832
🕑 connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/658114832
✅ connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/658114832

* Make sync modes required
* Provide Migration script making sure it is always defined for previous sync configs
@ChristopheDuong
Copy link
Contributor Author

ChristopheDuong commented Mar 19, 2021

Since this PR now introduces destination connectors that require destination sync modes to be defined, I will wait until the PR for the front-end (#2371) is ready before merging this one to master.

Otherwise, newly created sync will be failing since the UI won't be setting/defining destination sync modes yet

@ChristopheDuong ChristopheDuong changed the title Destinations supports destination sync mode ☝🏼Destinations supports destination sync mode Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Destinations support destination sync modes
5 participants