Github user HeartSaVioR commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21733#discussion_r208594904
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/package.scala
 ---
    @@ -81,4 +85,221 @@ package object state {
             storeCoordinator)
         }
       }
    +
    +  /**
    +   * Base trait for state manager purposed to be used from streaming 
aggregations.
    +   */
    +  sealed trait StreamingAggregationStateManager extends Serializable {
    +
    +    /**
    +     * Extract columns consisting key from input row, and return the new 
row for key columns.
    +     *
    +     * @param row The input row.
    +     * @return The row instance which only contains key columns.
    +     */
    +    def getKey(row: InternalRow): UnsafeRow
    --- End diff --
    
    `getKey` was basically UnsafeProjection in statefulOperator so didn't 
necessarily require UnsafeRow. I just followed the usage to make it less 
restrict, but we know, in reality `row` will be always UnsafeRow. So OK to fix 
if it provides consistency.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to