| 162 | } |
| 163 | |
| 164 | void OrcReader::Open(const ReaderOptions &options) { |
| 165 | // Must not open twice. |
| 166 | Assert(is_closed_); |
| 167 | if (options.reused_buffer) { |
| 168 | CBDB_CHECK(options.reused_buffer->IsMemTakeOver(), |
| 169 | cbdb::CException::ExType::kExTypeLogicError, |
| 170 | "Invalid memory owner in resued buffer"); |
| 171 | options.reused_buffer->BrushBackAll(); |
| 172 | format_reader_.SetReusedBuffer(options.reused_buffer); |
| 173 | } |
| 174 | |
| 175 | filter_ = options.filter; |
| 176 | |
| 177 | format_reader_.Open(); |
| 178 | is_closed_ = false; |
| 179 | |
| 180 | // only referenced, owner by caller who constructed ReadOptions |
| 181 | visibility_bitmap_ = options.visibility_bitmap; |
| 182 | } |
| 183 | |
| 184 | void OrcReader::ResetCurrentReading() { |
| 185 | working_group_ = nullptr; |