(res *parquetquery.IteratorResult)
| 3850 | } |
| 3851 | |
| 3852 | func (c *linkCollector) KeepGroup(res *parquetquery.IteratorResult) bool { |
| 3853 | var l *link |
| 3854 | |
| 3855 | // look for existing link first |
| 3856 | for _, e := range res.OtherEntries { |
| 3857 | if v, ok := e.Value.(*link); ok { |
| 3858 | l = v |
| 3859 | break |
| 3860 | } |
| 3861 | } |
| 3862 | |
| 3863 | // if not found create a new one |
| 3864 | if l == nil { |
| 3865 | l = getLink() |
| 3866 | } |
| 3867 | |
| 3868 | // extract from attribute collector |
| 3869 | for _, e := range res.OtherEntries { |
| 3870 | if v, ok := e.Value.(traceql.Static); ok { |
| 3871 | l.attrs = append(l.attrs, attrVal{ |
| 3872 | a: newLinkAttr(e.Key), |
| 3873 | s: v, |
| 3874 | }) |
| 3875 | } |
| 3876 | } |
| 3877 | |
| 3878 | for _, e := range res.Entries { |
| 3879 | switch e.Key { |
| 3880 | case columnPathLinkTraceID: |
| 3881 | l.attrs = append(l.attrs, attrVal{ |
| 3882 | a: traceql.NewIntrinsic(traceql.IntrinsicLinkTraceID), |
| 3883 | s: traceql.NewStaticString(util.TraceIDToHexString(e.Value.Bytes())), |
| 3884 | }) |
| 3885 | case columnPathLinkSpanID: |
| 3886 | l.attrs = append(l.attrs, attrVal{ |
| 3887 | a: traceql.NewIntrinsic(traceql.IntrinsicLinkSpanID), |
| 3888 | s: traceql.NewStaticString(util.SpanIDToHexString(e.Value.Bytes())), |
| 3889 | }) |
| 3890 | default: |
| 3891 | // null value indicates attribute doesn't exist |
| 3892 | if e.Value.IsNull() { |
| 3893 | l.attrs = append(l.attrs, attrVal{ |
| 3894 | a: newLinkAttr(e.Key), |
| 3895 | s: traceql.NewStaticString("nil"), |
| 3896 | }) |
| 3897 | } |
| 3898 | } |
| 3899 | } |
| 3900 | |
| 3901 | if c.minAttributes > 0 { |
| 3902 | if len(l.attrs) < c.minAttributes { |
| 3903 | putLink(l) |
| 3904 | return false |
| 3905 | } |
| 3906 | } |
| 3907 | |
| 3908 | res.Reset() |
| 3909 | res.AppendOtherValue(otherEntryLinkKey, l) |
nothing calls this directly
no test coverage detected