-
Notifications
You must be signed in to change notification settings - Fork 954
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
Ability to set the schema pattern for tables metadata retrieval #109
Ability to set the schema pattern for tables metadata retrieval #109
Conversation
Can one of the admins verify this patch? |
It looks like @pqueixalos hasn't signed our Contributor License Agreement, yet. Appreciation of efforts, clabot |
CLA just signed. |
@@ -144,6 +143,9 @@ | |||
public static final long TIMESTAMP_DELAY_INTERVAL_MS_DEFAULT = 0; | |||
private static final String TIMESTAMP_DELAY_INTERVAL_MS_DISPLAY = "Delay Interval (ms)"; | |||
|
|||
public static final String SCHEMA_PATTERN_CONFIG = "schemaPattern"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
schema.pattern
to be consistent with the config naming conventions
@pqueixalos is it possible to just include the schema in the connection URL? |
@shikhar, short answer : no. Regarding the changes you asked (whitespace and parameter naming, sure, I will make those changes next week). |
@pqueixalos would it work to update the code to use |
@@ -16,6 +16,12 @@ | |||
|
|||
package io.confluent.connect.jdbc; | |||
|
|||
import io.confluent.connect.jdbc.source.JdbcSourceConnectorConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's avoid the import rearrangement
Good point @shikhar, getting the schema from the connection (when set in jdbc connection params) might work fine in some situations ! |
@confluentinc It looks like @pqueixalos just signed our Contributor License Agreement. 👍 Always at your service, clabot |
@@ -104,8 +105,8 @@ public void start(Map<String, String> properties) throws ConnectException { | |||
// query. | |||
whitelistSet = Collections.emptySet(); | |||
} | |||
tableMonitorThread = new TableMonitorThread(db, context, tablePollMs, whitelistSet, | |||
blacklistSet, tableTypesSet); | |||
tableMonitorThread = new TableMonitorThread(db, schemaPattern, context, tablePollMs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pqueixalos sorry didn't notice this minor thing previously, but in terms of arg ordering schemaPattern
makes sense after the context
@pqueixalos ah too bad Redshift JDBC does not support that. So we need this patch to make the JDBC source connector usable against Redshift then. Left a couple more comments, otherwise LGTM cc @ewencp in case you have any thoughts on this |
ok to test |
@@ -190,6 +192,7 @@ public static ConfigDef baseConfigDef() { | |||
.define(BATCH_MAX_ROWS_CONFIG, Type.INT, BATCH_MAX_ROWS_DEFAULT, Importance.LOW, BATCH_MAX_ROWS_DOC, CONNECTOR_GROUP, 2, Width.SHORT, BATCH_MAX_ROWS_DISPLAY) | |||
.define(TABLE_POLL_INTERVAL_MS_CONFIG, Type.LONG, TABLE_POLL_INTERVAL_MS_DEFAULT, Importance.LOW, TABLE_POLL_INTERVAL_MS_DOC, CONNECTOR_GROUP, 3, Width.SHORT, TABLE_POLL_INTERVAL_MS_DISPLAY) | |||
.define(TOPIC_PREFIX_CONFIG, Type.STRING, Importance.HIGH, TOPIC_PREFIX_DOC, CONNECTOR_GROUP, 4, Width.MEDIUM, TOPIC_PREFIX_DISPLAY) | |||
.define(SCHEMA_PATTERN_CONFIG, Type.STRING, null, Importance.MEDIUM, SCHEMA_PATTERN_DOC, DATABASE_GROUP, 5, Width.SHORT, QUERY_DISPLAY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this in the right location? If it is part of the DATABASE_GROUP
should we relocate it with that group? And I think the order might not be quite right since it looks like there are only 3 items in the DATABASE_GROUP
so far. (It'd also be nice to include a DISPLAY setting as well for a more human-friendly form.)
@pqueixalos @shikhar Only took a quick scan through, but the changes seem fine. Major missing piece seems to be tests -- there were some updates to tests but it looks like they just use |
@ewencp I added a test in |
"Schema pattern to fetch tables metadata from:\n" | ||
+ " * \"\" retrieves those without a schema," | ||
+ " * null (default) means that the schema name should not be used to narrow the search, all tables " | ||
+ "metadata would be fetched, regardless there schema."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: s/there/their
@pqueixalos a few minor comments about the doc, otherwise LGTM |
Thanks for the contrib @pqueixalos! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This adds the ability to configure jdbc schemaPattern from connector configuration.
Reported here #32