(t *testing.T)
| 88 | } |
| 89 | |
| 90 | func TestNewStringInPredicate(t *testing.T) { |
| 91 | testCases := []predicateTestCase{ |
| 92 | { |
| 93 | testName: "all chunks/pages/values inspected", |
| 94 | predicate: func() Predicate { |
| 95 | return NewStringInPredicate([]string{"abc", "acd"}) |
| 96 | }(), |
| 97 | keptChunks: 1, |
| 98 | keptPages: 1, |
| 99 | keptValues: 2, |
| 100 | writeData: func(w *parquet.Writer) { //nolint:all |
| 101 | require.NoError(t, w.Write(&testDictString{"abc"})) // kept |
| 102 | require.NoError(t, w.Write(&testDictString{"acd"})) // kept |
| 103 | require.NoError(t, w.Write(&testDictString{"cde"})) // skipped |
| 104 | }, |
| 105 | }, |
| 106 | { |
| 107 | testName: "dictionary in the page header allows for skipping a column chunk", |
| 108 | predicate: func() Predicate { |
| 109 | return NewStringInPredicate([]string{"x"}) |
| 110 | }(), // Not present in any values |
| 111 | keptChunks: 0, |
| 112 | keptPages: 0, |
| 113 | keptValues: 0, |
| 114 | writeData: func(w *parquet.Writer) { //nolint:all |
| 115 | require.NoError(t, w.Write(&testDictString{"abc"})) |
| 116 | require.NoError(t, w.Write(&testDictString{"abc"})) |
| 117 | }, |
| 118 | }, |
| 119 | } |
| 120 | |
| 121 | for _, tC := range testCases { |
| 122 | t.Run(tC.testName, func(t *testing.T) { |
| 123 | testPredicate(t, tC) |
| 124 | }) |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | func TestNewRegexInPredicate(t *testing.T) { |
| 129 | testCases := []predicateTestCase{ |
nothing calls this directly
no test coverage detected