Jonathan Alvarado
02/24/2022, 5:58 PMsource-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
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:
if (tablesWithSelectGrantPrivilege.isEmpty()) {
return isNotInternalSchema(jsonNode, internalSchemas);
}
and the PostgresSource
has commented out the isNotInternalSchema()
method to always filter out the
@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?Jonathan Alvarado
02/24/2022, 9:22 PMJonathan Alvarado
02/24/2022, 9:25 PMJonathan Alvarado
02/24/2022, 11:35 PMisNotInternalSchema
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.Jordan Velich
02/24/2022, 11:54 PM