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

Count/unload a range of tokens: start token, end token #396

Open
smatvienko-tb opened this issue Nov 4, 2021 · 1 comment
Open

Count/unload a range of tokens: start token, end token #396

smatvienko-tb opened this issue Nov 4, 2021 · 1 comment

Comments

@smatvienko-tb
Copy link
Contributor

smatvienko-tb commented Nov 4, 2021

Hi guys!
For big workloads that take hours (days), it is good to be able to count/unload a range of tokens.
The aim is to split a huge task into smaller pieces, fit in maintain time-window, etc.
Another benefit is to be able to resume failed (for any reason) upload from some point (a token that found in upload-errors.log)

SELECT * FROM thingsboard.ts_kv_cf WHERE token(entity_type, entity_id, key, partition) > :start AND token(entity_type, entity_id, key, partition) <= :end
start: 2725990092663290223
end: 2748111336664437991

The parameters may look similar with nodetool repair syntax:
[(-st start_token | --start-token start_token)]
[(-et end_token | --end-token end_token)]

┆Issue is synchronized with this Jira Task by Unito

@adutra
Copy link
Contributor

adutra commented Jan 17, 2022

I agree that this would be very useful, but unfortunately it is not implemented yet.

However there is a simple workaround: use the -query parameter and provide the entire query, including a WHERE clause, e.g.:

dsbulk unload -query 'SELECT ... FROM ... WHERE token(...) > 2725990092663290223 AND token(...) <= 2748111336664437991'

This is usually easily scriptable.

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

No branches or pull requests

2 participants