CC-11984: Remove the table.whitelist
and table.blacklist
recommended values
#930
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The JDBC source connector uses a
TableRecommender
for thetable.whitelist
andtable.blacklist
properties. This recommender uses the connector properties to establish a connection, and then read the accessible tables.Unfortunately, AK's
ConfigDef
andAbstractConfig
class only pass to eachRecommender.validValues(...)
methods the parsed configuration properties, which are only those properties that are defined with aConfigDef
.In #870 we added the ability for users to define extra properties that would be passed to the JDBC driver when connecting to the database. These extra properties are not defined by
ConfigDef
as they vary by DBMS/driver, and therefore are not included when passed to any Recommender instances. In the case of theTableRecommender
, if the extra properties included any properties required for connections (e.g., kerberos-related properties for the JDBC driver), then the recommender would fail to connect and would throw a ConnectException. TheConfigDef
andAbstractConfig
then record this as a configuration error on the property with the recommender (e.g.,table.whitelist
ortable.blacklist
).IOW, if you use those extra
connector.*
properties to enable Kerberos, the connector would otherwise be able to connect except for the failingTableRecommender
that does not see/use thoseconnector.*
properties.One solution is to just change the
TableRecommender
to return an empty list if it could not connect, since any properties that prohibited connecting would have their own errors. Unfortunately, that results in a poor and inconsistent user experience, because sometimes the user would get recommended values in C3 fortable.whitelist
andtable.blacklist
, while other times they would get no recommended values. This behavior would not be very intuitive and would cause lots of headaches, since it would depend upon whether anyconnection.*
properties were required to connect to the database and read the accessible tables.Instead, the proposed solution is to simply remove
TableRecommender
altogether. This class has been a problem for quite some time:table.whitelist
and another time fortable.blacklist
.Since we're about to release the 10.0.0 version of the JDBC source and sink connectors, now would be a good time to change this behavior and remove this particular recommender. (The only other recommender in the JDBC source does not use a connection and is literally just a decision tree with other property values, so it’s worth keeping.)
Solution
Remove the
TableRecommender
to simplify the connector and eliminate potentially long-running operations. As a result, tools like C3 would no longer show recommended values fortable.whitelist
andtable.blacklist
properties.Does this solution apply anywhere else?
If yes, where?
Test Strategy
The test cases that verified the
TableRecommender
values were modified to assert that an empty list of tables is returned.Testing done:
Release Plan
Include in the upcoming 10.0.0 release. Since there is no
10.0.x
branch yet, this should be applied to themaster
branch.