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

Skip expired items of tables when TTL is enabled #206

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

julienrf
Copy link
Collaborator

@julienrf julienrf commented Aug 28, 2024

Fixes #179

@julienrf julienrf force-pushed the skip-expired-items branch from 5343327 to 6c9cb1d Compare August 28, 2024 10:05
@julienrf julienrf requested review from tarzanek and pdbossman August 28, 2024 10:06
@julienrf julienrf force-pushed the skip-expired-items branch from 6c9cb1d to 19dd66b Compare August 28, 2024 11:01
@julienrf julienrf marked this pull request as ready for review August 28, 2024 11:14
@julienrf julienrf changed the title Configure the TTL_ATTRIBUTE_NAME of the Hadoop job if TTL is enabled on a table attribute Skip expired items of tables when TTL is enabled Aug 28, 2024
Copy link
Contributor

@pdbossman pdbossman left a comment

Choose a reason for hiding this comment

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

I apologize, I've never written in scala... Where are we doing the compare that a record is expired? I would think we need to explicitly check the TTL timestamp of the column - a range comparison, and I'm not seeing it.

@julienrf
Copy link
Collaborator Author

julienrf commented Aug 28, 2024

No worries, I should have detailed the PR description.

This PR bumps the version of the DynamoDB connector to use a new feature that excludes expired items from a Scan operation.

The way it works is that here in the Migrator we configure the DynamoDB read operation by setting the parameter TTL_ATTRIBUTE_NAME when TTL is enabled on the table.

This configuration parameter is interpreted by the DynamoDB connector, which adds the desired filter to the Scan operation. That part was implemented in scylladb/emr-dynamodb-connector#10.

This way, the expired items are not even loaded in the Spark nodes.

@julienrf julienrf force-pushed the skip-expired-items branch from 19dd66b to 7a7b1fb Compare August 29, 2024 16:42
@julienrf
Copy link
Collaborator Author

Note that I created scylladb/emr-dynamodb-connector#11 which we might want to merge first and release in 5.7.1 before merging this PR.

@tarzanek tarzanek merged commit 25b8b69 into scylladb:master Aug 30, 2024
2 checks passed
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.

Enable exclude TTL expired on migrate
3 participants