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

Parallel scan in Full Table strategy #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tap_dynamodb/sync_strategies/full_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,20 @@ def scan_table(table_name, projection, expression, last_evaluated_key, config):
'''
Get all the records of the table by using `scan()` method with projection expression parameters
'''

# parallelize large scans
parallel_segment = config.get("parallel_segment", None)
parallel_totalsegments = config.get("parallel_totalsegments", None)

scan_params = {
'TableName': table_name,
'Limit': 1000
}

# add the parallel segment and the total number of segments in the parameters to the `scan`
if parallel_segment and parallel_totalsegments:
scan_params["Segment"] = int(parallel_segment)
scan_params["TotalSegments"] = int(parallel_totalsegments)

# add the projection expression in the parameters to the `scan`
if projection is not None and projection != '':
Expand Down