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

Prefix scans #15

Open
greglook opened this issue Nov 17, 2018 · 0 comments
Open

Prefix scans #15

greglook opened this issue Nov 17, 2018 · 0 comments

Comments

@greglook
Copy link
Owner

The table/scan method should have a simple consumer API for making prefix scans on the table. This likely has specific behavior for each lexicoder, but it may be possible to generalize it:

  • bytes can trivially construct a key which matches a prefix of the key bytes.
  • string can similarly encode characters into key prefix bytes.
  • integer keys cannot easily construct a prefix, nor does it really make sense for them.
  • float keys similarly cannot be prefixed sensibly.
  • instant keys are converted to integers internally, so the same prefix restrictions apply. In most cases a 'prefix' query here means 'in this year' or 'in this month' or other time unit, for which a range scan would work just as well.
  • sequence keys could work by providing one or more elements of the sequence, even if the underlying key type does not support prefixes. If it does, then the last segment should be able to match a prefix against further key segments.
  • tuple keys should also be workable by providing one or more of the tuple elements to generate the prefix. This requires some care however, since by default a tuple lexicoder will throw an error if not all elements of the key are given.
  • reverse lexicoder requires a bit of thought, but it seems like it should compose with the other prefix approaches here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant