spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cloud-fan <...@git.apache.org>
Subject [GitHub] spark pull request #16417: [SPARK-19014][SQL] support complex aggregate buff...
Date Fri, 30 Dec 2016 11:54:33 GMT
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16417#discussion_r94222440
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeProjection.scala
---
    @@ -92,46 +89,53 @@ object GenerateUnsafeProjection extends CodeGenerator[Seq[Expression],
UnsafePro
           s"$rowWriter.reset();"
         }
     
    -    val writeFields = inputs.zip(inputTypes).zipWithIndex.map {
    -      case ((input, dataType), index) =>
    +    val writeFields = inputs.zip(inputsTypeAndNullable).zipWithIndex.map {
    +      case ((input, (dataType, nullable)), index) =>
             val dt = dataType match {
               case udt: UserDefinedType[_] => udt.sqlType
               case other => other
             }
             val tmpCursor = ctx.freshName("tmpCursor")
     
             val setNull = dt match {
    -          case t: DecimalType if t.precision > Decimal.MAX_LONG_DIGITS =>
    -            // Can't call setNullAt() for DecimalType with precision larger than 18.
    -            s"$rowWriter.write($index, (Decimal) null, ${t.precision}, ${t.scale});"
    +          case dt if UnsafeRow.isMutable(dt) && !UnsafeRow.isFixedLength(dt)
=>
    +            def varLenDataSize(s: DataType): Int = s match {
    +              case t: DecimalType if t.precision > Decimal.MAX_LONG_DIGITS => 16
    --- End diff --
    
    yup


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

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


Mime
View raw message