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-bigquery: escape column names and update google cloud bigquery artifact #11484

Merged
merged 13 commits into from
Apr 13, 2022

Conversation

mkhokh-33
Copy link
Contributor

What

Escape column tames for big query source.
If a sync contains a column thats a reserved identifier eg. interval we get an exception message from BigQuery stating the sql statement is invalid

How

Escape column tames for big query source during selection with spec char '`'

Recommended reading order

  1. x.java
  2. y.python

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
  • If new credentials are required for use in CI, add them to GSM. 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
  • If new credentials are required for use in CI, add them to GSM. 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
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@github-actions github-actions bot added the area/connectors Connector related issues label Mar 28, 2022
@mkhokh-33 mkhokh-33 linked an issue Mar 28, 2022 that may be closed by this pull request
@mkhokh-33 mkhokh-33 marked this pull request as ready for review March 28, 2022 21:50
@mkhokh-33
Copy link
Contributor Author

/test connector=connectors/source-bigquery

@mkhokh-33 mkhokh-33 requested review from DoNotPanicUA and etsybaev and removed request for sashaNeshcheret and VitaliiMaltsev March 29, 2022 10:23
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

public class BigQuerySourceEscapeColumnNameTest {
Copy link
Contributor

@DoNotPanicUA DoNotPanicUA Mar 29, 2022

Choose a reason for hiding this comment

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

As this test is a copy of the BigQuerySourceTest test, please avoid copypasting. We can merge them or create an abstract class for such tests.

@mkhokh-33
Copy link
Contributor Author

mkhokh-33 commented Mar 31, 2022

/test connector=connectors/source-bigquery

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

Copy link
Contributor

@etsybaev etsybaev left a comment

Choose a reason for hiding this comment

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

Left a minor comment. Approving in advance, PR to fix as per comments. Thanks

@@ -42,7 +42,7 @@
public static final String CONFIG_PROJECT_ID = "project_id";
public static final String CONFIG_CREDS = "credentials_json";

private final String quote = "";
private final String quote = "`";
Copy link
Contributor

Choose a reason for hiding this comment

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

static final String QUOTE?

@mkhokh-33 mkhokh-33 assigned edgao and unassigned ChristopheDuong and subodh1810 Apr 6, 2022
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Apr 11, 2022
@mkhokh-33 mkhokh-33 temporarily deployed to more-secrets April 11, 2022 14:53 Inactive
@mkhokh-33 mkhokh-33 temporarily deployed to more-secrets April 11, 2022 14:53 Inactive
@mkhokh-33
Copy link
Contributor Author

mkhokh-33 commented Apr 12, 2022

/publish connector=connectors/source-bigquery

🕑 connectors/source-bigquery https://github.com/airbytehq/airbyte/actions/runs/2154421044
❌ Failed to publish connectors/source-bigquery
❌ Couldn't auto-bump version for connectors/source-bigquery

@mkhokh-33 mkhokh-33 temporarily deployed to more-secrets April 12, 2022 11:11 Inactive
@mkhokh-33
Copy link
Contributor Author

mkhokh-33 commented Apr 12, 2022

/publish connector=connectors/source-bigquery

🕑 connectors/source-bigquery https://github.com/airbytehq/airbyte/actions/runs/2154533666
❌ Failed to publish connectors/source-bigquery
❌ Couldn't auto-bump version for connectors/source-bigquery

@mkhokh-33 mkhokh-33 temporarily deployed to more-secrets April 12, 2022 11:11 Inactive
@mkhokh-33
Copy link
Contributor Author

mkhokh-33 commented Apr 12, 2022

/publish connector=connectors/source-bigquery

🕑 connectors/source-bigquery https://github.com/airbytehq/airbyte/actions/runs/2155784278
❌ Failed to publish connectors/source-bigquery
❌ Couldn't auto-bump version for connectors/source-bigquery

@mkhokh-33
Copy link
Contributor Author

mkhokh-33 commented Apr 12, 2022

/publish connector=connectors/source-bigquery

🕑 connectors/source-bigquery https://github.com/airbytehq/airbyte/actions/runs/2155851739
❌ Failed to publish connectors/source-bigquery
❌ Couldn't auto-bump version for connectors/source-bigquery

@mkhokh-33 mkhokh-33 temporarily deployed to more-secrets April 12, 2022 15:09 Inactive
@mkhokh-33 mkhokh-33 temporarily deployed to more-secrets April 12, 2022 15:09 Inactive
@mkhokh-33 mkhokh-33 temporarily deployed to more-secrets April 12, 2022 15:45 Inactive
@mkhokh-33
Copy link
Contributor Author

mkhokh-33 commented Apr 13, 2022

/publish connector=connectors/source-bigquery

🕑 connectors/source-bigquery https://github.com/airbytehq/airbyte/actions/runs/2162564360
🚀 Successfully published connectors/source-bigquery
🚀 Auto-bumped version for connectors/source-bigquery
✅ connectors/source-bigquery https://github.com/airbytehq/airbyte/actions/runs/2162564360

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets April 13, 2022 17:04 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets April 13, 2022 17:04 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets April 13, 2022 19:31 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets April 13, 2022 19:31 Inactive
@mkhokh-33 mkhokh-33 merged commit 3500554 into master Apr 13, 2022
@mkhokh-33 mkhokh-33 deleted the mkhokh/10383-source-bigquery-escape-column-name branch April 13, 2022 19:58
suhomud pushed a commit that referenced this pull request May 23, 2022
… artifact (#11484)

* source-bigquery: escape column names and update google cloud bigquery artifact

* source-bigquery: escape column names and update google cloud bigquery artifact

* source-bigquery: fix formatting

* source-bigquery: fix review comments

* bump versions

* bump versions source_specs.yaml

* revert bump versions

* fix publish-command.yml

* revert publish-command.yml

* auto-bump connector version

Co-authored-by: Octavia Squidington III <[email protected]>
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.

BigQuery connector doesn't escape column names
7 participants