| 216 | }; |
| 217 | |
| 218 | IterationResult FillRepLevels(int64_t count, int16_t rep_level, |
| 219 | PathWriteContext* context) { |
| 220 | if (rep_level == kLevelNotSet) { |
| 221 | return kDone; |
| 222 | } |
| 223 | int64_t fill_count = count; |
| 224 | // This condition occurs (rep and dep levels equals), in one of |
| 225 | // in a few cases: |
| 226 | // 1. Before any list is encountered. |
| 227 | // 2. After rep-level has been filled in due to null/empty |
| 228 | // values above it. |
| 229 | // 3. After finishing a list. |
| 230 | if (!context->EqualRepDefLevelsLengths()) { |
| 231 | fill_count--; |
| 232 | } |
| 233 | return context->AppendRepLevels(fill_count, rep_level); |
| 234 | } |
| 235 | |
| 236 | // A node for handling an array that is discovered to have all |
| 237 | // null elements. It is referred to as a TerminalNode because |
no test coverage detected