jacktengg commented on code in PR #57100:
URL: https://github.com/apache/doris/pull/57100#discussion_r2443749796
##########
be/src/olap/predicate_creator.h:
##########
@@ -65,15 +71,29 @@ class IntegerPredicateCreator : public
PredicateCreator<ConditionType> {
private:
static CppType convert(const std::string& condition) {
CppType value = 0;
- // because std::from_chars can't compile on macOS
- if constexpr (std::is_same_v<CppType, double>) {
- value = std::stod(condition, nullptr);
- } else if constexpr (std::is_same_v<CppType, float>) {
- value = std::stof(condition, nullptr);
+ if constexpr (std::is_floating_point_v<CppType>) {
+ auto ret = fast_float::from_chars(condition.data(),
condition.data() + condition.size(),
Review Comment:
Better to use `CastToFloat::from_string` to keep unified behavior for
casting string to float/double
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]