MCPcopy
hub / github.com/grafana/tempo / TestLeftJoinDown

Function TestLeftJoinDown

pkg/parquetquery/iters_test.go:496–600  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

494}
495
496func TestLeftJoinDown(t *testing.T) {
497 iter1DefLevel := 2
498 iter1 := &testIterator{rows: []IteratorResult{
499 testResult("x", "A", 0, 0, 1),
500 testResult("x", "B", 0, 0, 2),
501 testResult("x", "C", 0, 0, 3),
502 }}
503
504 // Defined at level iter2DefLevel
505 iter2DefLevel := 3
506 iter2 := &testIterator{rows: []IteratorResult{
507 testResult("y", "A1", 0, 0, 1, 0),
508 testResult("y", "A2", 0, 0, 1, 1),
509 testResult("y", "B1", 0, 0, 2, 0),
510 testResult("y", "B2", 0, 0, 2, 1),
511 testResult("y", "C", 0, 0, 3, 0),
512 }}
513
514 var buf IteratorResult
515
516 testCollector := &testCollector{
517 reset: func(rowNumber RowNumber) {
518 buf.Reset()
519 buf.RowNumber = rowNumber
520 },
521 collect: func(r *IteratorResult, _ any) {
522 buf.Append(r)
523 },
524 result: func() *IteratorResult {
525 return &buf
526 },
527 }
528
529 expected := []IteratorResult{
530 {
531 RowNumber: rn(0, 0, 1, 0),
532 OtherEntries: []struct {
533 Key string
534 Value interface{}
535 }{
536 {Key: "y", Value: "A1"},
537 {Key: "x", Value: "A"},
538 },
539 },
540 {
541 RowNumber: rn(0, 0, 1, 1),
542 OtherEntries: []struct {
543 Key string
544 Value interface{}
545 }{
546 {Key: "y", Value: "A2"},
547 },
548 },
549 {
550 RowNumber: rn(0, 0, 2, 0),
551 OtherEntries: []struct {
552 Key string
553 Value interface{}

Callers

nothing calls this directly

Calls 10

ResetMethod · 0.95
AppendMethod · 0.95
NextMethod · 0.95
testResultFunction · 0.85
rnFunction · 0.85
NewLeftJoinIteratorFunction · 0.85
WithIteratorFunction · 0.85
WithCollectorFunction · 0.85
cloneFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected