raminqaf commented on code in PR #29221:
URL: https://github.com/apache/flink/pull/29221#discussion_r4060630274


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/calls/SearchOperatorGen.scala:
##########
@@ -85,12 +85,21 @@ object SearchOperatorGen {
       val haystack = rangeSet
         .asRanges()
         .asScala
+        .toSeq
         // We need to go through the generateLiteral to normalize the value 
from calcite
         .map(r => toFlinkInternalValue(r.lowerEndpoint, sargType))
         // The elements are constant, we perform the cast immediately
         .map(CastRuleProvider.cast(toCastContext(ctx), sargType, commonType, 
_))
+        // The hash sets use boxed equality, whereas SQL equality equates both 
signs of zero.
+        .flatMap {
+          case value: java.lang.Float if value.floatValue() == 0.0f =>
+            Seq(value, java.lang.Float.valueOf(-value.floatValue()))
+          case value: java.lang.Double if value.doubleValue() == 0.0d =>
+            Seq(value, java.lang.Double.valueOf(-value.doubleValue()))
+          case value => Seq(value)
+        }

Review Comment:
   How about instead of adding `-0.0d` or `-0.0f` we fix this in 
`FloatHashSet.java` and `DoubleHashSet.java`
   
   Try something like this:
   ```java
   long longKey = Double.doubleToLongBits(k == 0.0d ? 0.0d : k);
   ```
   
   WDTY @snuyanzin?



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

Reply via email to