Skip to content
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

[FEATURE] Feature request: I want to filter dynamoDB tables into Athena as configurable list #606 #607

Closed
wants to merge 4 commits into from

Conversation

vaquarkhan
Copy link

@vaquarkhan vaquarkhan commented Dec 18, 2021

Issue #, if available: [FEATURE] Feature request: I want to filter tables to list into DynamoDB #606

Description of changes:

User has multiple teams and tables also contain KMS key few are configured via Lake formation , now I can see following issues.

  • Added new filter method
  • Updated existing method to filter tables
  • Lambda need to create manual env variable and add values "dynamo_connector_filter"
  • Requested to add cloud formation so future will be part of AWS code

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

7.	dynamo_connector_filter (Optional) Can be used to fetch selected tables from DynamoDB. By default the connector will attempt to get all DynamoDB tables while connect via Athena. . (e.g. *  or tbl1,tbl2,tbl3)
Note : “dynamo_connector_filter” is not available with existing connectors code , I have updated code to meet requirements, in order to use dynaodb table filter.
Updated document added dynamo db filter information in .7
@vaquarkhan vaquarkhan changed the title [FEATURE] Feature request: I want to filter tables to list into DynamoDB #606 [FEATURE] Feature request: I want to filter dynamoDB tables into Athena as configurable list #606 Dec 18, 2021

private Set<TableName> filterTables(Set<TableName> combinedTables)
{
String dynamoDBFilter = "*";
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like dynamoDBFilter is immediately overwritten after being initialized to "*" (on line 242).

This line should just be replaced with:

String dynamoDBFilter = System.getenv("dynamo_connector_filter");

And then remove line 242

}

if (null != dynamoDBFilter) {
flag = dynamoDBFilter.toUpperCase().contains("*");
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the filter is set to: sometable1,sometable2*,sometable3 ?

I think either we should throw an exception here or implement actual wildcard or regex matching if you want to support the case where a * is contained in the filter rather than equals the filter.

@AbdulR3hman
Copy link
Contributor

closing this as it has been stale for long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants