From 8e5cd5e6b0e1bdeb56152e42cfe07ff8130b47fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Fri, 12 Jan 2024 10:45:36 +0000 Subject: [PATCH] Try a different approach --- src/Interpreters/convertFieldToType.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Interpreters/convertFieldToType.cpp b/src/Interpreters/convertFieldToType.cpp index 4e38103ac1f..c3b8405659a 100644 --- a/src/Interpreters/convertFieldToType.cpp +++ b/src/Interpreters/convertFieldToType.cpp @@ -492,10 +492,11 @@ Field convertFieldToTypeImpl(const Field & src, const IDataType & type, const ID if (src.getType() == Field::Types::String) { /// Promote data type to avoid overflows. Note that overflows in the largest data type are still possible. + /// But don't promote Float32, since we want to keep the exact same value const IDataType * type_to_parse = &type; DataTypePtr holder; - if (type.canBePromoted()) + if (type.canBePromoted() && !which_type.isFloat32()) { holder = type.promoteNumericType(); type_to_parse = holder.get();