(a *v1.KeyValue, p *Attribute)
| 236 | } |
| 237 | |
| 238 | func attrToParquet(a *v1.KeyValue, p *Attribute) { |
| 239 | p.Key = a.Key |
| 240 | p.Value = nil |
| 241 | p.ValueArray = "" |
| 242 | p.ValueBool = nil |
| 243 | p.ValueDouble = nil |
| 244 | p.ValueInt = nil |
| 245 | p.ValueKVList = "" |
| 246 | |
| 247 | switch v := a.GetValue().Value.(type) { |
| 248 | case *v1.AnyValue_StringValue: |
| 249 | p.Value = &v.StringValue |
| 250 | case *v1.AnyValue_IntValue: |
| 251 | p.ValueInt = &v.IntValue |
| 252 | case *v1.AnyValue_DoubleValue: |
| 253 | p.ValueDouble = &v.DoubleValue |
| 254 | case *v1.AnyValue_BoolValue: |
| 255 | p.ValueBool = &v.BoolValue |
| 256 | case *v1.AnyValue_ArrayValue: |
| 257 | jsonBytes := &bytes.Buffer{} |
| 258 | _ = jsonMarshaler.Marshal(jsonBytes, a.Value) // deliberately marshalling a.Value because of AnyValue logic |
| 259 | p.ValueArray = jsonBytes.String() |
| 260 | case *v1.AnyValue_KvlistValue: |
| 261 | jsonBytes := &bytes.Buffer{} |
| 262 | _ = jsonMarshaler.Marshal(jsonBytes, a.Value) // deliberately marshalling a.Value because of AnyValue logic |
| 263 | p.ValueKVList = jsonBytes.String() |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | // traceToParquet converts a tempopb.Trace to this schema's object model. Returns the new object and |
| 268 | // a bool indicating if it's a connected trace or not |
no test coverage detected