@@ -222,6 +222,31 @@ func TestBackendBlockSearchTraceQL(t *testing.T) {
222
222
},
223
223
},
224
224
},
225
+ // Cross-type comparisons
226
+ {".crossint > 122.9" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint > 122.9}` )},
227
+ {".crossint >= 122.9" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint >= 122.9}` )},
228
+ {".crossint <= 123.0" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint <= 123.0}` )},
229
+ {".crossint = 123.0" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint = 123.0}` )},
230
+ {".crossint != 123.1" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint != 123.1}` )},
231
+ {".crossint >= 123.0" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint >= 123.0}` )},
232
+ {".crossint < 123.1" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint < 123.1}` )},
233
+ {".crossint <= 123.1" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint <= 123.1}` )},
234
+ {".crossfloat_nofrag > 455" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag > 455}` )},
235
+ {".crossfloat_nofrag >= 455" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag >= 455}` )},
236
+ {".crossfloat_nofrag <= 456" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag <= 456}` )},
237
+ {".crossfloat_nofrag = 456" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag = 456}` )},
238
+ {".crossfloat_nofrag != 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag != 457}` )},
239
+ {".crossfloat_nofrag >= 456" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag >= 456}` )},
240
+ {".crossfloat_nofrag <= 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag <= 457}` )},
241
+ {".crossfloat_nofrag < 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag < 457}` )},
242
+ {".crossfloat_frag != 455" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag != 455}` )},
243
+ {".crossfloat_frag > 455" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag > 455}` )},
244
+ {".crossfloat_frag >= 455" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag >= 455}` )},
245
+ {".crossfloat_frag > 456" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag > 456}` )},
246
+ {".crossfloat_frag >= 456" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag >= 456}` )},
247
+ {".crossfloat_frag <= 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag <= 457}` )},
248
+ {".crossfloat_frag < 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag < 457}` )},
249
+ {".crossfloat_frag != 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag != 457}` )},
225
250
}
226
251
227
252
for _ , tc := range searchesThatMatch {
@@ -348,6 +373,31 @@ func TestBackendBlockSearchTraceQL(t *testing.T) {
348
373
},
349
374
},
350
375
},
376
+ // Cross-type comparisons
377
+ {".crossint < 122.9" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint < 122.9}` )},
378
+ {".crossint = 122.9" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint = 122.9}` )},
379
+ {".crossint <= 122.9" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint <= 122.9}` )},
380
+ {".crossint < 123.0" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint < 123.0}` )},
381
+ {".crossint != 123.0" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint != 123.0}` )},
382
+ {".crossint > 123.0" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint > 123.0}` )},
383
+ {".crossint >= 123.1" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint >= 123.1}` )},
384
+ {".crossint = 123.1" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint = 123.1}` )},
385
+ {".crossint > 123.1" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossint > 123.1}` )},
386
+ {".crossfloat_nofrag < 455" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag < 455}` )},
387
+ {".crossfloat_nofrag = 455" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag = 455}` )},
388
+ {".crossfloat_nofrag <= 455" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag <= 455}` )},
389
+ {".crossfloat_nofrag < 456" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag < 456}` )},
390
+ {".crossfloat_nofrag != 456" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag != 456}` )},
391
+ {".crossfloat_nofrag > 456" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag > 456}` )},
392
+ {".crossfloat_nofrag >= 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag >= 457}` )},
393
+ {".crossfloat_nofrag = 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag = 457}` )},
394
+ {".crossfloat_nofrag > 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_nofrag > 457}` )},
395
+ {".crossfloat_frag < 456" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag < 456}` )},
396
+ {".crossfloat_frag = 456" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag = 456}` )},
397
+ {".crossfloat_frag <= 456" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag <= 456}` )},
398
+ {".crossfloat_frag >= 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag >= 457}` )},
399
+ {".crossfloat_frag = 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag = 457}` )},
400
+ {".crossfloat_frag > 457" , traceql .MustExtractFetchSpansRequestWithMetadata (`{.crossfloat_frag > 457}` )},
351
401
}
352
402
353
403
for _ , tc := range searchesThatDontMatch {
@@ -475,7 +525,10 @@ func fullyPopulatedTestTrace(id common.ID) *Trace {
475
525
{Key : "bar" , ValueInt : intPtr (123 )},
476
526
{Key : "float" , ValueDouble : fltPtr (456.78 )},
477
527
{Key : "bool" , ValueBool : boolPtr (false )},
478
-
528
+ // For cross-type comparisons
529
+ {Key : "crossint" , ValueInt : intPtr (123 )},
530
+ {Key : "crossfloat_nofrag" , ValueDouble : fltPtr (456.0 )},
531
+ {Key : "crossfloat_frag" , ValueDouble : fltPtr (456.78 )},
479
532
// Edge-cases
480
533
{Key : LabelName , Value : strPtr ("Bob" )}, // Conflicts with intrinsic but still looked up by .name
481
534
{Key : LabelServiceName , Value : strPtr ("spanservicename" )}, // Overrides resource-level dedicated column
0 commit comments