I’m using the latest 0.4.8 `source-postgres` sourc...
# connector-development
j
I’m using the latest 0.4.8
source-postgres
source and I have a problem where I’m not able to list any tables in my source even though my user is able to select from the tables. I see there are a couple relevant tickets. * https://github.com/airbytehq/airbyte/pull/9875 * https://github.com/airbytehq/airbyte/pull/10173 I debugged and found that in
AbstractJdbcSource.discoverInternal()
where it filters tables with
excludeNotAccessibleTables
Copy code
protected Predicate<JsonNode> excludeNotAccessibleTables(final Set<String> internalSchemas,
                                                           final Set<JdbcPrivilegeDto> tablesWithSelectGrantPrivilege) {
the
tablesWithSelectGrantPrivilege
variable was empty. So because of that it entered this branch:
Copy code
if (tablesWithSelectGrantPrivilege.isEmpty()) {
        return isNotInternalSchema(jsonNode, internalSchemas);
      }
and the
PostgresSource
has commented out the
isNotInternalSchema()
method to always filter out the
Copy code
@Override
  protected boolean isNotInternalSchema(JsonNode jsonNode, Set<String> internalSchemas) {
    return false;
  }
If the
isNotInternalSchema
wasn’t overriden by postgres then my tables show up properly. I’m trying to understand the logic behind this? Whether the problem is with
getPrivilegesTableForCurrentUser
or that the
isNotInternalSchema
should not be overridden? Can someone shed some light on the philosophy behind how the
AbstractJdbcSource.excludeNotAccessibleTables
is supposed to work and the reasoning behind the
PostgresSource.isNotInternalSchema
overriding?
@Liren Tu (Airbyte) do you have some hints to share on this topic? @Jonathan Alvarado, if you found a way to solve your problem I'd suggest you open a PR with the fix and our reviewer team will make sure your contribution matches our "philosophy" 😄
@[DEPRECATED] Augustin Lafanechere Thanks for the suggestion
I had no idea about the two PRs that led to this: - https://github.com/airbytehq/airbyte/pull/9875https://github.com/airbytehq/airbyte/pull/10173 But it looks like
isNotInternalSchema
was a new method introduced between PR 9875 and PR 10173. When PR 10173 tried to revert PR 9875, it added the
isNotInternalSchema
with a default implementation without thinking about what it meant. This is probably a bug. I am surprised that neither of the PRs tagged the core Airbyte connector team for review. @Sherif Nada, FYI. I will create a new issue to track this.
j