-
Notifications
You must be signed in to change notification settings - Fork 115
Labels
triagePending for triagingPending for triaging
Description
What happened?
In AggregationOperation.scala, the helper minValue uses Double.MIN_VALUE for AttributeType.DOUBLE. In Java/Scala, Double.MIN_VALUE is the smallest positive non-zero double, not the most-negative value. This makes the “minimum seed” for DOUBLE aggregations incorrect when the intended behavior is to represent the lowest possible value (per discussion #4049, the intent is negative infinity).
Lines 335 to 345 in 07c35d0
| private def minValue(attributeType: AttributeType): Object = | |
| attributeType match { | |
| case AttributeType.INTEGER => Integer.MIN_VALUE.asInstanceOf[Object] | |
| case AttributeType.DOUBLE => java.lang.Double.MIN_VALUE.asInstanceOf[Object] | |
| case AttributeType.LONG => java.lang.Long.MIN_VALUE.asInstanceOf[Object] | |
| case AttributeType.TIMESTAMP => new Timestamp(0) | |
| case _ => | |
| throw new UnsupportedOperationException( | |
| "Unsupported attribute type for min value: " + attributeType | |
| ) | |
| } |
How to reproduce?
- Open
texera/common/workflow-operator/src/main/scala/org/apache/amber/operator/aggregate/AggregationOperation.scala. - Locate
minValue(attributeType: AttributeType)(around thecase AttributeType.DOUBLEbranch). - Note it returns
java.lang.Double.MIN_VALUE. - Expected: the value should be
Double.NEGATIVE_INFINITY.
Related discussion: #4049
Version
1.1.0-incubating (Pre-release/Master)
Commit Hash (Optional)
No response
What browsers are you seeing the problem on?
No response
Relevant log output
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
triagePending for triagingPending for triaging