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

🎉Source-redshift: added an optional field for schema\s selection #9721

Merged
merged 10 commits into from Jan 26, 2022

Conversation

etsybaev
Copy link
Contributor

@etsybaev etsybaev commented Jan 23, 2022

What

Currently we are not able to select a particular schema for selection. That causes a mess and inconvenience if you have multiple schemas but want to migrate only some of them.

How

Added a new optional field on UI for schema selection similarly to Postgres and Oracle source connectors.

  • No schema selected explicitly- will process all of existing in source DB
  • One or more explicitly selected on UI - will show and process only selected.

!!!!!!!TODO ONCE PR APPROVED: !!!!!!!!!!

  • update docs
  • finish all PR's checklist

Tested locally:
All schemas are shown If no schemas selected explicitly
Selection_409
Selection_408

Tested with particular schema selection
Selection_410
Selection_412
Selection_413
Selection_414

Recommended reading order

  1. spec.json
  2. RedshiftSource.java

🚨 User Impact 🚨

The newly added field is an optional one. So breaks in backward compatibility are expected.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/SUMMARY.md
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the new connector version is published, connector version bumped in the seed directory as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here

@github-actions github-actions bot added the area/connectors Connector related issues label Jan 23, 2022
@etsybaev etsybaev linked an issue Jan 23, 2022 that may be closed by this pull request
@etsybaev
Copy link
Contributor Author

etsybaev commented Jan 23, 2022

/test connector=connectors/source-redshift

🕑 connectors/source-redshift https://github.com/airbytehq/airbyte/actions/runs/1736398244
✅ connectors/source-redshift https://github.com/airbytehq/airbyte/actions/runs/1736398244
No Python unittests run

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 23, 2022 16:24 Inactive
@etsybaev etsybaev changed the title [DRAFT_PR][9525] source-redshift: added schema selection [DRAFT_PR]🎉Source-redshift: added an optional fields for schema\s selection Jan 24, 2022
@etsybaev etsybaev changed the title [DRAFT_PR]🎉Source-redshift: added an optional fields for schema\s selection 🎉Source-redshift: added an optional field for schema\s selection Jan 24, 2022
@etsybaev etsybaev marked this pull request as ready for review January 24, 2022 11:54
@etsybaev etsybaev temporarily deployed to more-secrets January 24, 2022 11:54 Inactive
@etsybaev etsybaev requested a review from edgao January 25, 2022 18:20
…election

# Conflicts:
#	airbyte-integrations/connectors/source-redshift/src/main/resources/spec.json
@etsybaev etsybaev temporarily deployed to more-secrets January 25, 2022 20:52 Inactive
@etsybaev etsybaev requested a review from edgao January 25, 2022 21:05
@@ -52,6 +53,9 @@ protected void setupEnvironment(final TestDestinationEnv environment) throws Exc
RedshiftSource.DRIVER_CLASS);

schemaName = Strings.addRandomSuffix("integration_test", "_", 5).toLowerCase();

config = config.set("schemas", Jsons.jsonNode(List.of(schemaName)));

final String createSchemaQuery = String.format("CREATE SCHEMA %s", schemaName);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also create a second schema (like unselected_schema) with some tables, and verify in the acceptance test that the catalog will not include anything in the second schema?

Otherwise, I think the schema selection is not tested any where currently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved data creation to a separate method and added one more schema creation to have some noise. Thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

I just realized that the SourceAcceptanceTest does not actually verify the catalog. I created an issue to track it:
#9818

@etsybaev etsybaev temporarily deployed to more-secrets January 26, 2022 13:39 Inactive
@etsybaev
Copy link
Contributor Author

etsybaev commented Jan 26, 2022

/test connector=connectors/source-redshift

🕑 connectors/source-redshift https://github.com/airbytehq/airbyte/actions/runs/1751477075
✅ connectors/source-redshift https://github.com/airbytehq/airbyte/actions/runs/1751477075
No Python unittests run

@etsybaev etsybaev requested a review from tuliren January 26, 2022 15:08
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 15:10 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets January 26, 2022 16:35 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets January 26, 2022 17:50 Inactive
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Jan 26, 2022
@etsybaev etsybaev temporarily deployed to more-secrets January 26, 2022 19:29 Inactive
@etsybaev
Copy link
Contributor Author

etsybaev commented Jan 26, 2022

/publish connector=connectors/source-redshift

🕑 connectors/source-redshift https://github.com/airbytehq/airbyte/actions/runs/1752699724
✅ connectors/source-redshift https://github.com/airbytehq/airbyte/actions/runs/1752699724

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 26, 2022 19:44 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets January 26, 2022 20:02 Inactive
@etsybaev etsybaev merged commit 5bce24c into master Jan 26, 2022
@etsybaev etsybaev deleted the etsybaev/9525-source-redshift-add-schema-selection branch January 26, 2022 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support schema selection for Redshift source connector
5 participants