| 107 | } |
| 108 | |
| 109 | void fillDoubleValues(const std::vector<std::string>& data, orc::ColumnVectorBatch* batch, |
| 110 | uint64_t numValues, uint64_t colIndex) { |
| 111 | orc::DoubleVectorBatch* dblBatch = dynamic_cast<orc::DoubleVectorBatch*>(batch); |
| 112 | bool hasNull = false; |
| 113 | for (uint64_t i = 0; i < numValues; ++i) { |
| 114 | std::string col = extractColumn(data[i], colIndex); |
| 115 | if (col.empty()) { |
| 116 | batch->notNull[i] = 0; |
| 117 | hasNull = true; |
| 118 | } else { |
| 119 | batch->notNull[i] = 1; |
| 120 | dblBatch->data[i] = atof(col.c_str()); |
| 121 | } |
| 122 | } |
| 123 | dblBatch->hasNulls = hasNull; |
| 124 | dblBatch->numElements = numValues; |
| 125 | } |
| 126 | |
| 127 | // parse fixed point decimal numbers |
| 128 | void fillDecimalValues(const std::vector<std::string>& data, orc::ColumnVectorBatch* batch, |