(t *testing.T)
| 387 | } |
| 388 | |
| 389 | func TestIntInPredicate(t *testing.T) { |
| 390 | testCases := []predicateTestCase{ |
| 391 | { |
| 392 | testName: "all chunks/pages/values inspected", |
| 393 | predicate: func() Predicate { |
| 394 | var p Predicate = NewIntInPredicate([]int64{1, 3}) |
| 395 | return p |
| 396 | }(), |
| 397 | keptChunks: 1, |
| 398 | keptPages: 1, |
| 399 | keptValues: 2, |
| 400 | writeData: func(w *parquet.Writer) { //nolint:all |
| 401 | require.NoError(t, w.Write(&testInt{1})) // kept |
| 402 | require.NoError(t, w.Write(&testInt{2})) // skipped |
| 403 | require.NoError(t, w.Write(&testInt{3})) // kept |
| 404 | require.NoError(t, w.Write(&testInt{10})) // skipped |
| 405 | }, |
| 406 | }, |
| 407 | { |
| 408 | testName: "dictionary allows skipping a column chunk when no ints match", |
| 409 | predicate: func() Predicate { |
| 410 | var p Predicate = NewIntInPredicate([]int64{0, 4, 100}) |
| 411 | return p |
| 412 | }(), |
| 413 | keptChunks: 0, |
| 414 | keptPages: 0, |
| 415 | keptValues: 0, |
| 416 | writeData: func(w *parquet.Writer) { //nolint:all |
| 417 | require.NoError(t, w.Write(&testInt{1})) |
| 418 | require.NoError(t, w.Write(&testInt{2})) |
| 419 | require.NoError(t, w.Write(&testInt{3})) |
| 420 | }, |
| 421 | }, |
| 422 | } |
| 423 | |
| 424 | for _, tC := range testCases { |
| 425 | t.Run(tC.testName, func(t *testing.T) { |
| 426 | testPredicate(t, tC) |
| 427 | }) |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | func TestIntNotInPredicate(t *testing.T) { |
| 432 | testCases := []predicateTestCase{ |
nothing calls this directly
no test coverage detected