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

Function convertStringToDecimalType

src/Interpreters/convertFieldToType.cpp:123–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121
122template <typename T>
123static Field convertStringToDecimalType(const Field & from, const DataTypeDecimal<T> & type)
124{
125 const String & str_value = from.get<String>();
126 T value = type.parseFromString(str_value);
127 return DecimalField<T>(value, type.getScale());
128}
129
130template <typename From, typename T>
131static Field convertDecimalToDecimalType(const Field & from, const DataTypeDecimal<T> & type)

Callers 1

convertDecimalTypeFunction · 0.85

Calls 2

parseFromStringMethod · 0.45
getScaleMethod · 0.45

Tested by

no test coverage detected