checkBoundRefs checks if the bound field is referencing a valid alias. If no valid alias is reference, this method returns an error specifying an incorrect alias reference.
()
| 568 | // If no valid alias is reference, this method returns an error specifying |
| 569 | // an incorrect alias reference. |
| 570 | func (f *filter) checkBoundRefs() error { |
| 571 | if f.seq == nil { |
| 572 | return nil |
| 573 | } |
| 574 | |
| 575 | aliases := make(map[string]bool) |
| 576 | for _, expr := range f.seq.Expressions { |
| 577 | if expr.Alias == "" { |
| 578 | continue |
| 579 | } |
| 580 | aliases[expr.Alias] = true |
| 581 | } |
| 582 | |
| 583 | for _, field := range f.boundFields { |
| 584 | if _, ok := aliases[field.BoundVar.Value]; !ok { |
| 585 | return fmt.Errorf("%s bound field references "+ |
| 586 | "an invalid '$%s' event alias", |
| 587 | field.String(), field.BoundVar.Value) |
| 588 | } |
| 589 | } |
| 590 | |
| 591 | return nil |
| 592 | } |
| 593 | |
| 594 | func makeSequenceLinkID(valuer ql.MapValuer, link *ql.SequenceLink) any { |
| 595 | if !link.IsCompound() { |