Skip to content

Comments

Table Command to KeyValue store Mapping#5

Open
darshannevgi wants to merge 10 commits intoacharapko:masterfrom
darshannevgi:TableToKV
Open

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

Conversation

@darshannevgi
Copy link
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
"fmt"
)

func TestSave(t *testing.T) {
Copy link
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
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?

}

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

@acharapko acharapko Dec 1, 2019

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
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
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.

batch.Put(item.Key,item.Value)
}
}
//batch.Put([]byte("foo"), []byte("value"))
Copy link
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


}

func (db *database) Save(tableid uuid.UUID, items []KVItem) error {
Copy link
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

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
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

return rows,err
}

func createRow(partitionKeys []FleetDBValue, oldCKeyvalues []FleetDBValue, oldColvalues []FleetDBValue) Row{
Copy link
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

return Row{row}
}

func createRowFromMap(valMap map[string]FleetDBValue, columns []string) Row{
Copy link
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

return Row{row}
}

func equal(val1 []FleetDBValue, val2 []FleetDBValue) bool{
Copy link
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