Skip to content

minValue uses Double.MIN_VALUE instead of Double.NEGATIVE_INFINITY #4144

Closed

Description

@carloea2

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).

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?

  1. Open texera/common/workflow-operator/src/main/scala/org/apache/amber/operator/aggregate/AggregationOperation.scala.
  2. Locate minValue(attributeType: AttributeType) (around the case AttributeType.DOUBLE branch).
  3. Note it returns java.lang.Double.MIN_VALUE.
  4. 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

Activity

  1. added theissue type on Jan 5, 2026
  2. added a commit that references this issue on Jan 10, 2026
    ab3317b
  3. added a commit that references this issue on May 20, 2026
    b6d7da0
  4. added a commit that references this issue on Jun 22, 2026
    c6878ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions