Skip to content

🐛 Source Postgres: views are not listed during schema discovery - #8266

Merged
Alexander Tsukanov (alexandertsukanov) merged 8 commits into
masterfrom
otsukanov/airbyte-8254_views_not_listed_during_discovery
Nov 26, 2021
Merged

Alexander Tsukanov (alexandertsukanov) merged 8 commits into
masterfrom
otsukanov/airbyte-8254_views_not_listed_during_discovery

Conversation

@alexandertsukanov

@alexandertsukanov Alexander Tsukanov (alexandertsukanov) commented Nov 26, 2021 •

Copy link
Copy Markdown
Contributor

What

During investigation of bug #8254 was found the DatabaseMetaData.getTablePrivileges() method does not return privileges for VIEWS.

How

Instead of using DatabaseMetaData.getTablePrivileges() use native SQL query to get SELECT privileges for USER tables.

Recommended reading order

  1. x.java

🚨 User Impact 🚨

Are there any breaking changes? If yes, please make sure to include it here and in any changelogs with the 🚨🚨 emoji
What is the end result perceived by the user?

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

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.

@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Nov 26, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/source-postgres

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

@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Nov 26, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/source-postgres-strict-encrypt

🕑 connectors/source-postgres-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1506846547
✅ connectors/source-postgres-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1506846547
No Python unittests run

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 26, 2021 09:04 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 26, 2021 09:04 Inactive
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets November 26, 2021 11:22 Inactive
@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Nov 26, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/source-postgres

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

@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets November 26, 2021 11:24 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 26, 2021 11:25 Inactive

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice job! we can proceed with publishing and merging.

// we need the schema as different schemas could have tables with the same names
.schemaName(ofNullable(resultSet.getString(JDBC_COLUMN_SCHEMA_NAME)).orElse(EMPTY))
.tableName(ofNullable(resultSet.getString(JDBC_COLUMN_TABLE_NAME)).orElse(EMPTY))
.privilege(ofNullable(resultSet.getString(PRIVILEGE)).orElse(EMPTY))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems that
protected static final String GRANTEE = "GRANTEE";
protected static final String PRIVILEGE = "PRIVILEGE";

in AbstractJdbcSource class
will not be used after this change, if so could you pls remove them.

@github-actions github-actions Bot added the area/documentation Improvements or additions to documentation label Nov 26, 2021
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets November 26, 2021 13:52 Inactive
@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Nov 26, 2021 •

Copy link
Copy Markdown
Contributor Author

/publish connector=connectors/source-postgres

🕑 connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/1507814238
✅ connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/1507814238

@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Nov 26, 2021 •

Copy link
Copy Markdown
Contributor Author

/publish connector=connectors/source-postgres-strict-encrypt

🕑 connectors/source-postgres-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1507815406
✅ connectors/source-postgres-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1507815406

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 26, 2021 13:58 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 26, 2021 13:58 Inactive
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets November 26, 2021 16:05 Inactive
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets November 26, 2021 16:20 Inactive
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) deleted the otsukanov/airbyte-8254_views_not_listed_during_discovery branch November 26, 2021 16:22
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets November 26, 2021 16:23 Inactive
Konrad Schlatte (schlattk) pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
…ytehq#8266)

* airbyte-8254 Source Postgres: views are not listed during schema discovery

* airbyte-8254 Source Postgres: views are not listed during schema discovery

* airbyte-8254 Source Postgres: views are not listed during schema discovery

* airbyte-8254 Remove GRANTEE and PRIVILEGE constants from AbstractJdbcSource.java

* airbyte-8254 Version bumped.

* airbyte-8254 Version bumped.

* airbyte-8254 Version bumped.

This branch was previously deployed

1 inactive deployment
more-secrets — b4dedcc0 Deployed Nov 26, 2021 by alexandertsukanov
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.

Source Postgres: views are not listed during schema discovery

4 participants