| 76 | } |
| 77 | |
| 78 | static inline void handleParseFromStringError(ColumnVectorBatch& dstBatch, uint64_t idx, |
| 79 | bool shouldThrow, const std::string& typeName, |
| 80 | const std::string& str, |
| 81 | const std::string& expectedFormat = "") { |
| 82 | if (!shouldThrow) { |
| 83 | dstBatch.notNull.data()[idx] = 0; |
| 84 | dstBatch.hasNulls = true; |
| 85 | } else { |
| 86 | std::ostringstream ss; |
| 87 | ss << "Failed to parse " << typeName << " from string:" << str; |
| 88 | if (expectedFormat != "") { |
| 89 | ss << " the following format \"" << expectedFormat << "\" is expected"; |
| 90 | } |
| 91 | throw SchemaEvolutionError(ss.str()); |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | // return false if overflow |
| 96 | template <typename ReadType> |
no test coverage detected