This is an automated email from the ASF dual-hosted git repository.
lgbo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
The following commit(s) were added to refs/heads/main by this push:
new 15c99ba09 ensure same results from NaN (#6301)
15c99ba09 is described below
commit 15c99ba093440766d332f85fd873961c47774f66
Author: lgbo <[email protected]>
AuthorDate: Tue Jul 2 09:56:02 2024 +0800
ensure same results from NaN (#6301)
---
cpp-ch/local-engine/Functions/SparkFunctionHashingExtended.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/cpp-ch/local-engine/Functions/SparkFunctionHashingExtended.h
b/cpp-ch/local-engine/Functions/SparkFunctionHashingExtended.h
index 82d678aa2..57bf00ba9 100644
--- a/cpp-ch/local-engine/Functions/SparkFunctionHashingExtended.h
+++ b/cpp-ch/local-engine/Functions/SparkFunctionHashingExtended.h
@@ -28,6 +28,7 @@
#include <DataTypes/DataTypeNullable.h>
#include <DataTypes/NumberTraits.h>
#include <Functions/FunctionsHashing.h>
+#include <Common/NaNUtils.h>
namespace DB
{
@@ -200,14 +201,14 @@ private:
{
if constexpr (std::is_same_v<T, Float32>)
{
- if (n == -0.0f) [[unlikely]]
+ if (n == -0.0f || isNaN(n)) [[unlikely]]
return applyNumber<Int32>(0, seed);
else
return Impl::apply(reinterpret_cast<const char *>(&n),
sizeof(n), seed);
}
else
{
- if (n == -0.0) [[unlikely]]
+ if (n == -0.0 || isNaN(n)) [[unlikely]]
return applyNumber<Int64>(0, seed);
else
return Impl::apply(reinterpret_cast<const char *>(&n),
sizeof(n), seed);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]