mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-12 07:41:02 +00:00
check same rowID for same frame in actions
This commit is contained in:
parent
6d12478e6b
commit
e0bf37da40
1 changed files with 6 additions and 6 deletions
|
|
@ -94,19 +94,19 @@ func (i *InputDefinition) LoadDefinition(pb *internal.InputDefinition) error {
|
|||
}
|
||||
|
||||
numPrimaryKey := 0
|
||||
countRowID := make(map[uint64]bool)
|
||||
countRowID := make(map[string]uint64)
|
||||
for _, field := range pb.Fields {
|
||||
var actions []Action
|
||||
for _, action := range field.Actions {
|
||||
if err := i.ValidateAction(action); err != nil {
|
||||
return err
|
||||
}
|
||||
if action.RowID != 0 {
|
||||
_, ok := countRowID[action.RowID]
|
||||
if !ok {
|
||||
countRowID[action.RowID] = true
|
||||
} else {
|
||||
if action.RowID != 0 && action.Frame != ""{
|
||||
val, ok := countRowID[action.Frame]
|
||||
if ok && val == action.RowID {
|
||||
return fmt.Errorf("duplicate rowID with other field: %s", action.RowID)
|
||||
} else {
|
||||
countRowID[action.Frame] = action.RowID
|
||||
}
|
||||
}
|
||||
actions = append(actions, Action{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue