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

    https://github.com/apache/spark/pull/9599#discussion_r44444756
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/TypedAggregateExpression.scala
 ---
    @@ -93,32 +96,51 @@ case class TypedAggregateExpression(
           case a: AttributeReference => inputMapping(a)
         })
     
    -  // TODO: this probably only works when we are in the first column.
       val bAttributes = bEncoder.schema.toAttributes
       lazy val boundB = bEncoder.resolve(bAttributes).bind(bAttributes)
     
    +  private def updateBuffer(buffer: MutableRow, value: InternalRow): Unit = 
{
    +    // todo: need a more neat way to assign the value.
    +    var i = 0
    +    while (i < aggBufferAttributes.length) {
    +      aggBufferSchema(i).dataType match {
    +        case IntegerType => buffer.setInt(mutableAggBufferOffset + i, 
value.getInt(i))
    +        case LongType => buffer.setLong(mutableAggBufferOffset + i, 
value.getLong(i))
    --- End diff --
    
    Maybe something like `BufferSetterGetterUtils`?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to