flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhueske <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-3474] support partial aggregate
Date Tue, 01 Mar 2016 13:20:10 GMT
Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1746#discussion_r54564821
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/runtime/aggregate/MaxAggregate.scala
---
    @@ -17,68 +17,96 @@
      */
     package org.apache.flink.api.table.runtime.aggregate
     
    +import org.apache.calcite.sql.`type`.SqlTypeName
    +import org.apache.flink.api.table.Row
    +
     abstract class MaxAggregate[T: Numeric] extends Aggregate[T] {
     
    -  var result: T = _
    -  val numericResult = implicitly[Numeric[T]]
    +  private val numeric = implicitly[Numeric[T]]
     
    -  override def aggregate(value: Any): Unit = {
    -    val input: T = value.asInstanceOf[T]
    +  /**
    +   * Initiate the partial aggregate value in Row.
    +   * @param intermediate
    +   */
    +  override def initiate(intermediate: Row): Unit = {
    +    intermediate.setField(aggOffsetInRow, numeric.zero)
    --- End diff --
    
    should initialize to the minimum value of the data type instead of `numeric.zero`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message