Skip to content

Table to KV Mapping #1

@acharapko

Description

@acharapko

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions