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

Table to KV Mapping #1

Open
acharapko opened this issue Sep 16, 2019 · 0 comments
Open

Table to KV Mapping #1

acharapko opened this issue Sep 16, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@acharapko
Copy link
Owner

Mimicking Cassandra's table structure, we need a way to map Cassandra-like tables to the KV abstraction. Internally, we will replicate data as array of Key-Value pairs, but data from Cassandra-like API is going to come in table format.

For example, CQL table: CREATE TABLE t (pk int PRIMARY KEY, column1 int, column2 int);
needs top be mapped to some number of Key-Value cells that we can efficiently retrieve at once using SCAN

Similar, this table may have much larger partition, with unlimited number of cells, but we still need to efficiently retrieve them from KV-store: CREATE TABLE t (pk int, ck1 int, ck2 text, column1 int, column2 int, PRIMARY KEY(pk, ck1, ck2));

right now in kv_store package we have direct mapping from command to store. in Table abstraction, the user request is not going to be represented by Command (and Command itself will change). We need to create a different package "table_store" and in there we need to have methods to handle the mapping from table to KV. These mapping methods will take slices of column names in table, and values as []byte, and create a list of KV-pairs for store (GoLevelDB)
Do not worry about the execute method so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants