github-actions[bot] commented on code in PR #68258:
URL: https://github.com/apache/doris/pull/68258#discussion_r4056555714


##########
be/src/exprs/function/math.cpp:
##########
@@ -643,6 +643,15 @@ class FunctionMathBinary : public IFunction {
             auto& a = column_left_ptr->get_data();
             auto& c = column_result->get_data();
             size_t size = a.size();
+            if constexpr (std::is_same_v<Impl, PowImpl>) {
+                // Dispatch once per block, keeping libm calls out of the 
squaring loop.
+                if (column_right_ptr->template get_value<Impl::type>() == 2.0) 
{

Review Comment:
   [P1] Keep `pow` results independent of column shape and BE version. This 
branch is the only shape that uses multiplication; `vector_vector`, 
`constant_vector`, and all-constant evaluation still call libm. For `x = 
1.1500729535343723e-17`, libm returns `0x1.5fa01b171cd7ap-113` while `x * x` 
returns `0x1.5fa01b171cd7bp-113`, so the same argument values become unequal 
DOUBLE keys depending on whether the exponent is physically constant. The same 
split occurs across old/new BEs during a rolling upgrade and can produce 
separate `GROUP BY`/join keys for identical source values. Please preserve one 
value semantics across shapes and mixed versions (or avoid the specialization 
until that is possible), and add an exact-bit counterexample across the 
const-mask matrix; the current values plus `EXPECT_DOUBLE_EQ` do not detect 
this.



-- 
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]

Reply via email to