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

Function TestIntNotInPredicate

pkg/parquetquery/predicates_test.go:431–470  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

429}
430
431func TestIntNotInPredicate(t *testing.T) {
432 testCases := []predicateTestCase{
433 {
434 testName: "all chunks/pages/values inspected",
435 predicate: func() Predicate {
436 var p Predicate = NewIntNotInPredicate([]int64{1, 3})
437 return p
438 }(),
439 keptChunks: 1,
440 keptPages: 1,
441 keptValues: 2,
442 writeData: func(w *parquet.Writer) { //nolint:all
443 require.NoError(t, w.Write(&testInt{1})) // skipped
444 require.NoError(t, w.Write(&testInt{2})) // kept
445 require.NoError(t, w.Write(&testInt{3})) // skipped
446 require.NoError(t, w.Write(&testInt{4})) // kept
447 },
448 },
449 {
450 testName: "dictionary allows skipping a column chunk when all ints excluded",
451 predicate: func() Predicate {
452 var p Predicate = NewIntNotInPredicate([]int64{7, 8})
453 return p
454 }(),
455 keptChunks: 0,
456 keptPages: 0,
457 keptValues: 0,
458 writeData: func(w *parquet.Writer) { //nolint:all
459 require.NoError(t, w.Write(&testInt{7}))
460 require.NoError(t, w.Write(&testInt{8}))
461 },
462 },
463 }
464
465 for _, tC := range testCases {
466 t.Run(tC.testName, func(t *testing.T) {
467 testPredicate(t, tC)
468 })
469 }
470}

Callers

nothing calls this directly

Calls 4

NewIntNotInPredicateFunction · 0.85
testPredicateFunction · 0.85
WriteMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected