| 54 | } |
| 55 | |
| 56 | void fillLongValues(const std::vector<std::string>& data, orc::ColumnVectorBatch* batch, |
| 57 | uint64_t numValues, uint64_t colIndex) { |
| 58 | orc::LongVectorBatch* longBatch = dynamic_cast<orc::LongVectorBatch*>(batch); |
| 59 | bool hasNull = false; |
| 60 | for (uint64_t i = 0; i < numValues; ++i) { |
| 61 | std::string col = extractColumn(data[i], colIndex); |
| 62 | if (col.empty()) { |
| 63 | batch->notNull[i] = 0; |
| 64 | hasNull = true; |
| 65 | } else { |
| 66 | batch->notNull[i] = 1; |
| 67 | longBatch->data[i] = atoll(col.c_str()); |
| 68 | } |
| 69 | } |
| 70 | longBatch->hasNulls = hasNull; |
| 71 | longBatch->numElements = numValues; |
| 72 | } |
| 73 | |
| 74 | void fillStringValues(const std::vector<std::string>& data, orc::ColumnVectorBatch* batch, |
| 75 | uint64_t numValues, uint64_t colIndex, orc::DataBuffer<char>& buffer) { |