| 168 | } |
| 169 | |
| 170 | void 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 |
| 194 | void fillDateValues(const std::vector<std::string>& data, orc::ColumnVectorBatch* batch, |
no test coverage detected