MCPcopy Create free account
hub / github.com/ByConity/ByConity / tryReadValue

Method tryReadValue

src/Processors/Formats/Impl/ValuesBlockInputFormat.cpp:186–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186bool 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
221namespace
222{

Callers

nothing calls this directly

Calls 7

skipWhitespaceIfAnyFunction · 0.85
isParseErrorFunction · 0.85
rollbackToCheckpointMethod · 0.80
isNullableMethod · 0.45
deserializeTextQuotedMethod · 0.45
codeMethod · 0.45
popBackMethod · 0.45

Tested by

no test coverage detected