MCPcopy Index your code
hub / github.com/apache/orc / fillBoolValues

Function fillBoolValues

tools/src/CSVFileImport.cc:170–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170void fillBoolValues(const std::vector<std::string>& data, orc::ColumnVectorBatch* batch,
171 uint64_t numValues, uint64_t colIndex) {
172 orc::LongVectorBatch* boolBatch = dynamic_cast<orc::LongVectorBatch*>(batch);
173 bool hasNull = false;
174 for (uint64_t i = 0; i < numValues; ++i) {
175 std::string col = extractColumn(data[i], colIndex);
176 if (col.empty()) {
177 batch->notNull[i] = 0;
178 hasNull = true;
179 } else {
180 batch->notNull[i] = 1;
181 std::transform(col.begin(), col.end(), col.begin(), ::tolower);
182 if (col == "true" || col == "t") {
183 boolBatch->data[i] = true;
184 } else {
185 boolBatch->data[i] = false;
186 }
187 }
188 }
189 boolBatch->hasNulls = hasNull;
190 boolBatch->numElements = numValues;
191}
192
193// parse date string from format YYYY-mm-dd
194void fillDateValues(const std::vector<std::string>& data, orc::ColumnVectorBatch* batch,

Callers 1

mainFunction · 0.85

Calls 2

extractColumnFunction · 0.85
endMethod · 0.65

Tested by

no test coverage detected