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

Quote cursor name to support uppercase letters (required by postgres) #28892

Merged
merged 4 commits into from
Aug 1, 2023

Conversation

rodireich
Copy link
Contributor

@rodireich rodireich commented Aug 1, 2023

What

Quote cursor field in getting max value query.
Postgres requires quotes to preserve case sensitivity in queries

closes #28879

@rodireich rodireich requested a review from a team as a code owner August 1, 2023 00:43
@octavia-squidington-iii octavia-squidington-iii added the area/connectors Connector related issues label Aug 1, 2023
@rodireich rodireich changed the title quote cursor name to support uppercase letters (required by postgres) Quote cursor name to support uppercase letters (required by postgres) Aug 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

final String cursorField = cursorInfoOptional.get().getCursorField();
final String cursorBasedSyncStatusQuery = String.format(MAX_CURSOR_VALUE_QUERY,
cursorField,
name,
cursorField,
cursorField,
name);
LOGGER.info("*** {}", cursorBasedSyncStatusQuery);
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove if not needed. Same with L154

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed. thanks

Copy link
Contributor

@nguyenaiden nguyenaiden left a comment

Choose a reason for hiding this comment

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

Awesome catch. Thanks for this!

@octavia-squidington-iii
Copy link
Collaborator

source-alloydb test report (commit 520138bcc9) - ❌

⏲️ Total pipeline duration: 02mn29s

Step Result
Validate airbyte-integrations/connectors/source-alloydb/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-alloydb docker image for platform linux/x86_64

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-alloydb test

@octavia-squidington-iii
Copy link
Collaborator

source-postgres-strict-encrypt test report (commit 520138bcc9) - ✅

⏲️ Total pipeline duration: 02mn33s

Step Result

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-postgres-strict-encrypt test

@octavia-squidington-iii
Copy link
Collaborator

source-postgres test report (commit 520138bcc9) - ✅

⏲️ Total pipeline duration: 02mn33s

Step Result

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-postgres test

@octavia-squidington-iii
Copy link
Collaborator

source-alloydb-strict-encrypt test report (commit 520138bcc9) - ❌

⏲️ Total pipeline duration: 02mn31s

Step Result
Validate airbyte-integrations/connectors/source-alloydb-strict-encrypt/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-alloydb-strict-encrypt docker image for platform linux/x86_64

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-alloydb-strict-encrypt test

@octavia-squidington-iii
Copy link
Collaborator

source-alloydb-strict-encrypt test report (commit ff5d523184) - ✅

⏲️ Total pipeline duration: 02mn31s

Step Result

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-alloydb-strict-encrypt test

@octavia-squidington-iii
Copy link
Collaborator

source-alloydb test report (commit ff5d523184) - ❌

⏲️ Total pipeline duration: 02mn29s

Step Result
Validate airbyte-integrations/connectors/source-alloydb/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-alloydb docker image for platform linux/x86_64

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-alloydb test

@octavia-squidington-iii
Copy link
Collaborator

source-postgres-strict-encrypt test report (commit ff5d523184) - ❌

⏲️ Total pipeline duration: 02mn27s

Step Result
Validate airbyte-integrations/connectors/source-postgres-strict-encrypt/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-postgres-strict-encrypt docker image for platform linux/x86_64

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-postgres-strict-encrypt test

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

Coverage report for source-postgres

File Coverage [82.66%] 🍏
PostgresQueryUtils.java 82.66% 🍏
Total Project Coverage 70.27% 🍏

@octavia-squidington-iii
Copy link
Collaborator

source-postgres test report (commit ff5d523184) - ❌

⏲️ Total pipeline duration: 02mn34s

Step Result
Validate airbyte-integrations/connectors/source-postgres/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Build connector tar
Build source-postgres docker image for platform linux/x86_64

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-postgres test

@octavia-squidington-iii
Copy link
Collaborator

source-alloydb-strict-encrypt test report (commit 74de8f1b62) - ❌

⏲️ Total pipeline duration: 6.03s

Step Result
Validate airbyte-integrations/connectors/source-alloydb-strict-encrypt/metadata.yaml
Connector version semver check
QA checks
Build connector tar

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-alloydb-strict-encrypt test

@octavia-squidington-iii
Copy link
Collaborator

source-alloydb test report (commit 74de8f1b62) - ❌

⏲️ Total pipeline duration: 02mn28s

Step Result
Validate airbyte-integrations/connectors/source-alloydb/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-alloydb docker image for platform linux/x86_64

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-alloydb test

@octavia-squidington-iii
Copy link
Collaborator

source-postgres-strict-encrypt test report (commit 74de8f1b62) - ❌

⏲️ Total pipeline duration: 02mn31s

Step Result
Validate airbyte-integrations/connectors/source-postgres-strict-encrypt/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-postgres-strict-encrypt docker image for platform linux/x86_64

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-postgres-strict-encrypt test

@octavia-squidington-iii
Copy link
Collaborator

source-postgres test report (commit 74de8f1b62) - ❌

⏲️ Total pipeline duration: 02mn43s

Step Result
Validate airbyte-integrations/connectors/source-postgres/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Build connector tar
Build source-postgres docker image for platform linux/x86_64

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-postgres test

@@ -73,7 +73,7 @@ public record ResultWithFailed<T>(T result, List<io.airbyte.protocol.models.v0.A
""";
public static final String MAX_CURSOR_VALUE_QUERY =
"""
SELECT %s FROM %s WHERE %s = (SELECT MAX(%s) FROM %s);
SELECT "%s" FROM %s WHERE "%s" = (SELECT MAX("%s") FROM %s);
Copy link
Contributor

@prateekmukhedkar prateekmukhedkar Aug 1, 2023

Choose a reason for hiding this comment

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

verified by looking at NULL_CURSOR_VALUE_WITH_SCHEMA_QUERY and NULL_CURSOR_VALUE_NO_SCHEMA_QUERY that column names are enclosed in double quotes.

@rodireich
Copy link
Contributor Author

/approve-and-merge reason="tested locally. ci pipeline issue"

@octavia-approvington
Copy link
Contributor

Approve this
imagine the commander saying yes

@octavia-approvington octavia-approvington merged commit d37d2e2 into master Aug 1, 2023
@octavia-approvington octavia-approvington deleted the rodi/uppercase-cursor branch August 1, 2023 03:16
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.

Source-postgres case sensitive column issue. "updatedat" vs "users.updatedAt"
5 participants