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

F/support table filter expr #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

srjonemed
Copy link

Description of change

Extending full_table replication mode to optionally support Filtering. Dynamodb already supports the "FilterExpression", and "ExpressionAttributeValues" options as part of the scan table command. This PR passes through these options from Metadata (catalog) over to client.scan() via scan_params.

Manual QA steps

  • Step1: Update the catalog.json metadata section
    Here's an example table definition from catalog.json updated to have the FilterExpression
    {"table_name": "my-table-name", "stream": "my-table-name", "tap_stream_id": "my-table-name", "metadata": [{"breadcrumb": [], "metadata": {"table-key-properties": ["model_name", "created_date"], "row-count": 562522, "selected": true, "replication-method": "FULL_TABLE", "FilterExpression": "begins_with(created_date, :dt)", "ExpressionAttributeValues": "{\":dt\":{\"S\":\"2020-03-27\"}}"}}], "schema": {"type": "object"}}

  • Step2: Run the tap using the modified catalog.json
    bin/tap-dynamodb --config tap-dynamodb/config.json --catalog tap-dynamodb/catalog.json

  • Step3: Expected result, the source table "my-table-name" is scanned based on attribute "created_date" values beginning with "2020-03-27"

Risks

Rollback steps

  • revert this branch

@cmerrick
Copy link
Contributor

Hi @srjonemed, thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes.

@cmerrick
Copy link
Contributor

You did it @srjonemed!

Thank you for signing the Singer Contribution License Agreement.

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.

2 participants