| 184 | } |
| 185 | |
| 186 | bool ValuesBlockInputFormat::tryReadValue(IColumn & column, size_t column_idx) |
| 187 | { |
| 188 | bool rollback_on_exception = false; |
| 189 | try |
| 190 | { |
| 191 | bool read = true; |
| 192 | const auto & type = types[column_idx]; |
| 193 | const auto & serialization = serializations[column_idx]; |
| 194 | if (format_settings.null_as_default && !type->isNullable()) |
| 195 | read = SerializationNullable::deserializeTextQuotedImpl(column, buf, format_settings, serialization); |
| 196 | else |
| 197 | serialization->deserializeTextQuoted(column, buf, format_settings); |
| 198 | |
| 199 | rollback_on_exception = true; |
| 200 | |
| 201 | skipWhitespaceIfAny(buf); |
| 202 | assertDelimiterAfterValue(column_idx); |
| 203 | return read; |
| 204 | } |
| 205 | catch (const Exception & e) |
| 206 | { |
| 207 | /// Do not consider decimal overflow as parse error to avoid attempts to parse it as expression with float literal |
| 208 | bool decimal_overflow = e.code() == ErrorCodes::ARGUMENT_OUT_OF_BOUND; |
| 209 | if (!isParseError(e.code()) || decimal_overflow) |
| 210 | throw; |
| 211 | if (rollback_on_exception) |
| 212 | column.popBack(1); |
| 213 | |
| 214 | /// Switch to SQL parser and don't try to use streaming parser for complex expressions |
| 215 | /// Note: Throwing exceptions for each expression may be very slow because of stacktraces |
| 216 | buf.rollbackToCheckpoint(); |
| 217 | return parseExpression(column, column_idx); |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | namespace |
| 222 | { |
nothing calls this directly
no test coverage detected