Skip to content

Table Command to KeyValue store Mapping#5

Open
darshannevgi wants to merge 10 commits into
acharapko:masterfrom
darshannevgi:TableToKV
Open

Table Command to KeyValue store Mapping#5
darshannevgi wants to merge 10 commits into
acharapko:masterfrom
darshannevgi:TableToKV

Conversation

@darshannevgi

Copy link
Copy Markdown
Collaborator

Features:

  1. Structure to store Table Schema from CREATE TABLE CQL command
  2. Method to convert CQL command data(Insert Command) into Key-Value byte data to store into DB
  3. Structures and methods to serialize and deserialize different datatypes( Int, Float, BigInt, Text, Double, Boolean)
    4)Test files for testing all added features

@darshannevgi darshannevgi requested a review from acharapko October 9, 2019 05:15
Comment thread tablestore/db_test.go Outdated
"fmt"
)

func TestSave(t *testing.T) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Make sure to actually assert your tests for expected output, not just print to console

// "fmt"
)

func TestTranslateToKV(t *testing.T) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Make sure tests actually test different scenarios for correctness. Why are all assertions commented out?

Comment thread tablestore/utility.go Outdated
}

//Incomplete Implementation
func parseKey(data []KVItem){

@acharapko acharapko Dec 1, 2019

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Make sure to add a test to this function

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Also, try to test every major function you are writing

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

and of course, if this is all commented out, just remove.

Comment thread tablestore/database.go Outdated
batch.Put(item.Key,item.Value)
}
}
//batch.Put([]byte("foo"), []byte("value"))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

clean up the commented code. If something needs to be commented, please describe it in English and use example code if needed. But do not leave just lines and lines of commented code

Comment thread tablestore/database.go

}

func (db *database) Save(tableid uuid.UUID, items []KVItem) error {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Unit test for this, please

Comment thread tablestore/database.go Outdated
US || NY || Buffalo || University Avenue
US || NY || Columbus || EngleWood Avenue
*/
func (db *database) GetPartition(tableid uuid.UUID, partitionKeys []FleetDBValue , columns []string, tableSpec FleetDBTableSpec) ([]Row, error) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Unit test for this, please

Comment thread tablestore/database.go Outdated
return rows,err
}

func createRow(partitionKeys []FleetDBValue, oldCKeyvalues []FleetDBValue, oldColvalues []FleetDBValue) Row{

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Unit test for this, please

Comment thread tablestore/database.go
return Row{row}
}

func createRowFromMap(valMap map[string]FleetDBValue, columns []string) Row{

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Unit test for this, please

Comment thread tablestore/database.go
return Row{row}
}

func equal(val1 []FleetDBValue, val2 []FleetDBValue) bool{

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Unit test for this, please

@darshannevgi darshannevgi force-pushed the TableToKV branch 6 times, most recently from bdaecd0 to e644d01 Compare December 14, 2019 10:31
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.

2 participants