MCPcopy Create free account
hub / github.com/apache/orc / updateSelected

Method updateSelected

c++/src/Reader.cc:173–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171 }
172
173 void ColumnSelector::updateSelected(std::vector<bool>& selectedColumns,
174 const RowReaderOptions& options) {
175 selectedColumns.assign(static_cast<size_t>(contents_->footer->types_size()), false);
176 if (contents_->schema->getKind() == STRUCT && options.getIndexesSet()) {
177 for (std::list<uint64_t>::const_iterator field = options.getInclude().begin();
178 field != options.getInclude().end(); ++field) {
179 updateSelectedByFieldId(selectedColumns, *field);
180 }
181 } else if (contents_->schema->getKind() == STRUCT && options.getNamesSet()) {
182 for (std::list<std::string>::const_iterator field = options.getIncludeNames().begin();
183 field != options.getIncludeNames().end(); ++field) {
184 updateSelectedByName(selectedColumns, *field);
185 }
186 } else if (options.getTypeIdsSet()) {
187 const RowReaderOptions::IdReadIntentMap idReadIntentMap = options.getIdReadIntentMap();
188 for (std::list<uint64_t>::const_iterator typeId = options.getInclude().begin();
189 typeId != options.getInclude().end(); ++typeId) {
190 updateSelectedByTypeId(selectedColumns, *typeId, idReadIntentMap);
191 }
192 } else {
193 // default is to select all columns
194 std::fill(selectedColumns.begin(), selectedColumns.end(), true);
195 }
196 selectParents(selectedColumns, *contents_->schema.get());
197 selectedColumns[0] = true; // column 0 is selected by default
198 }
199
200 void ColumnSelector::updateSelectedByFieldId(std::vector<bool>& selectedColumns,
201 uint64_t fieldId) {

Callers 2

RowReaderImplMethod · 0.45
preBufferMethod · 0.45

Calls 8

getIndexesSetMethod · 0.80
getIncludeMethod · 0.80
getNamesSetMethod · 0.80
getTypeIdsSetMethod · 0.80
getIdReadIntentMapMethod · 0.80
getKindMethod · 0.65
endMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected