[ 
https://issues.apache.org/jira/browse/CALCITE-3039?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

dijkspicy updated CALCITE-3039:
-------------------------------
    Description: 
{code:java}
//代码占位符
/** Implementation of {@code MIN} function to calculate the minimum of
 * {@code float} values as a user-defined aggregate.
 */
public static class MinFloat extends NumericComparison<Float> {
  public MinFloat() {
    super(Float.MAX_VALUE, Math::min);
  }
}

/** Implementation of {@code MIN} function to calculate the minimum of
 * {@code double} and {@code real} values as a user-defined aggregate.
 */
public static class MinDouble extends NumericComparison<Double> {
  public MinDouble() {
    super(Double.MAX_VALUE, Math::max);
  }
}
{code}

  was:
  /** Implementation of {@code MIN} function to calculate the minimum of
   * {@code float} values as a user-defined aggregate.
   */
  public static class MinFloat extends NumericComparison<Float> {
    public MinFloat() {
      super(Float.MAX_VALUE, Math::min);
    }
  }

  /** Implementation of {@code MIN} function to calculate the minimum of
   * {@code double} and {@code real} values as a user-defined aggregate.
   */
  public static class MinDouble extends NumericComparison<Double> {
    public MinDouble() {
      super(Double.MAX_VALUE, Math::max);
    }
  }


> Why MinFloat use Math::min while MinDouble use Math::max as its comparision 
> in AggragateNode ?
> ----------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-3039
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3039
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: dijkspicy
>            Priority: Major
>              Labels: easyfix
>
> {code:java}
> //代码占位符
> /** Implementation of {@code MIN} function to calculate the minimum of
>  * {@code float} values as a user-defined aggregate.
>  */
> public static class MinFloat extends NumericComparison<Float> {
>   public MinFloat() {
>     super(Float.MAX_VALUE, Math::min);
>   }
> }
> /** Implementation of {@code MIN} function to calculate the minimum of
>  * {@code double} and {@code real} values as a user-defined aggregate.
>  */
> public static class MinDouble extends NumericComparison<Double> {
>   public MinDouble() {
>     super(Double.MAX_VALUE, Math::max);
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to