gemini
gemini copied to clipboard
Does not work with tuple fields in pk properly
Since gemini dump all the values into single value list:
func (g *Generator) createPartitionKeyValues(r *rand.Rand) []interface{} {
var values []interface{}
for _, pk := range g.table.PartitionKeys {
values = append(values, pk.Type.GenValue(r, g.partitionsConfig)...)
}
return values
}
And then extracts them by index assuming that index on resulted array matches PK:
func (rc *RoutingKeyCreator) CreateRoutingKey(table *Table, values []interface{}) ([]byte, error) {
...
for i := range partitionKeys {
encoded, err := gocql.Marshal(
partitionKeys[i].Type.CQLType(),
values[i],
)
...
Having more then 1 value in GenValue for the any PK member will leat to have values not matching PK members and subsequent failure.