You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by wojtek-szymanski <gi...@git.apache.org> on 2017/02/27 02:04:53 UTC

[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

GitHub user wojtek-szymanski opened a pull request:

    https://github.com/apache/spark/pull/17075

    [SPARK-19727][SQL] Fix for round function that modifies original column

    ## What changes were proposed in this pull request?
    
    Fix for SQL round function that modifies original column when underlying data frame is created from a local product.
    
        import org.apache.spark.sql.functions._
    
        case class NumericRow(value: BigDecimal)
    
        val df = spark.createDataFrame(Seq(NumericRow(BigDecimal("1.23456789"))))
    
        df.show()
        +--------------------+
        |               value|
        +--------------------+
        |1.234567890000000000|
        +--------------------+
    
        df.withColumn("value_rounded", round('value)).show()
        +--------------------+-------------+
        |               value|value_rounded|
        +--------------------+-------------+
        |1.000000000000000000|            1|
        +--------------------+-------------+
    
    ## How was this patch tested?
    
    New unit test added to existing suite `org.apache.spark.sql.MathFunctionsSuite`

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/wojtek-szymanski/spark SPARK-19727

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/17075.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17075
    
----
commit ea7c2d3d1b8d71bacc905d01ca327f465ca61c86
Author: Wojtek Szymanski <wk...@gmail.com>
Date:   2017-02-27T01:42:37Z

    Fix for SQL round function modifying original column

----


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104329369
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -223,6 +224,19 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       }
     
       /**
    +   * Create new `Decimal` with given precision and scale.
    +   *
    +   * @return `Some(decimal)` if successful or `None` if overflow would occur
    +   */
    +  private[sql] def toPrecision(
    --- End diff --
    
    style:
    ```
    def xxx(
        para1: xxx,
        para2: xxx): XXX
    ```


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by tejasapatil <gi...@git.apache.org>.
Github user tejasapatil commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103598023
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -362,17 +374,13 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       def abs: Decimal = if (this.compare(Decimal.ZERO) < 0) this.unary_- else this
     
       def floor: Decimal = if (scale == 0) this else {
    -    val value = this.clone()
    -    value.changePrecision(
    -      DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    -    value
    +    toPrecision(DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    +      .getOrElse(clone())
    --- End diff --
    
    This might end up creating two copies of the object in worst case :
    - once in `toPrecision`
    - second time on this line
    
    Old logic would guarantee a single copy.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/17075


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    @cloud-fan could you please give the green light to tests?


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    how about we add a new method `toPrecision` that returns `Option[Decimal]`? Most of the time we should call `toPrecision`, but for some performance critical path we should call `changePrecission`


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103864255
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -362,17 +374,13 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       def abs: Decimal = if (this.compare(Decimal.ZERO) < 0) this.unary_- else this
     
       def floor: Decimal = if (scale == 0) this else {
    -    val value = this.clone()
    -    value.changePrecision(
    -      DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    -    value
    +    toPrecision(DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    --- End diff --
    
    Theoretically, it should be `Some`. On the other hand if something goes wrong when setting new precision in `floor` or `ceil`, I would raise an internal error:
    
        def floor: Decimal = if (scale == 0) this else {
          val newPrecision = DecimalType.bounded(precision - scale + 1, 0).precision
          toPrecision(newPrecision, 0, ROUND_FLOOR).getOrElse(
            throw new AnalysisException(s"Overflow when setting precision to $newPrecision"))
        }


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/74195/
    Test PASSed.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104327814
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala ---
    @@ -233,6 +233,18 @@ class MathFunctionsSuite extends QueryTest with SharedSQLContext {
         )
       }
     
    +  test("round/bround with data frame from a local Seq of Product") {
    +    val df = spark.createDataFrame(Seq(NumericRow(BigDecimal("5.9"))))
    --- End diff --
    
    The fundamental difference is in the underlying row type assigned to dataframe/dataset. Dataframe is based on `GenericInternalRow`, while Dataset uses `UnsafeRow`. During evaluation of round expression, method `getDecimal` is called on a row, see [BoundAttribute.scala#L52](https://github.com/apache/spark/blob/39e2bad6a866d27c3ca594d15e574a1da3ee84cc/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/BoundAttribute.scala#L52). As a result `GenericInternalRow` returns just an element of an array, which points to the reference of the original column, see [rows.scala#L200](https://github.com/apache/spark/blob/97594c29b723f372a5c4c061760015bd78d01f50/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/rows.scala#L200). Strategy used in  `UnsafeRow` is completely different, so new decimal instance is created, see [UnsafeRow.java#L399](https://github.com/apache/spark/blob/a1e40b1f5d651305bbd0ba05779263a44f607498/sql/catalyst/src/main/java/org/apache/
 spark/sql/catalyst/expressions/UnsafeRow.java#L399).
    I hope it helps to explain why only dataframe is affected.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104354415
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -223,6 +224,19 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       }
     
       /**
    +   * Create new `Decimal` with given precision and scale.
    +   *
    +   * @return `Some(decimal)` if successful or `None` if overflow would occur
    +   */
    +  private[sql] def toPrecision(
    +                   precision: Int,
    --- End diff --
    
    Actually I did, but I saw so many different styles and I had no idea which one is correct. Thanks again for your patience


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    retest this please


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/74181/
    Test FAILed.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104329383
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala ---
    @@ -422,3 +434,4 @@ class MathFunctionsSuite extends QueryTest with SharedSQLContext {
         checkAnswer(df.selectExpr("positive(b)"), Row(-1))
       }
     }
    +case class NumericRow(value : BigDecimal)
    --- End diff --
    
    let's just use `Tuple1` instead of creating this class


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103864736
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -362,17 +374,13 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       def abs: Decimal = if (this.compare(Decimal.ZERO) < 0) this.unary_- else this
     
       def floor: Decimal = if (scale == 0) this else {
    -    val value = this.clone()
    -    value.changePrecision(
    -      DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    -    value
    +    toPrecision(DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    +      .getOrElse(clone())
    --- End diff --
    
    You're right, thanks. My suggestion is to raise an internal error if setting new precision in `floor` or `ceil` would fail.


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    **[Test build #74181 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74181/testReport)** for PR 17075 at commit [`fc0f2d1`](https://github.com/apache/spark/commit/fc0f2d11f60dc1eade4c32d5a56292766061886e).


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    ok to test


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Merged build finished. Test FAILed.


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Merged build finished. Test FAILed.


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Merged build finished. Test FAILed.


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/74135/
    Test FAILed.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103588721
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala ---
    @@ -339,36 +339,34 @@ case class Cast(child: Expression, dataType: DataType, timeZoneId: Option[String
       }
     
       /**
    -   * Change the precision / scale in a given decimal to those set in `decimalType` (if any),
    -   * returning null if it overflows or modifying `value` in-place and returning it if successful.
    +   * Create new `Decimal` with precision and scale given in `decimalType` (if any),
    +   * returning null if it overflows or creating a new `value` and returning it if successful.
        *
    -   * NOTE: this modifies `value` in-place, so don't call it on external data.
        */
    -  private[this] def changePrecision(value: Decimal, decimalType: DecimalType): Decimal = {
    -    if (value.changePrecision(decimalType.precision, decimalType.scale)) value else null
    -  }
    +  private[this] def toPrecision(value: Decimal, decimalType: DecimalType): Decimal =
    +    value.toPrecision(decimalType.precision, decimalType.scale).orNull
     
       private[this] def castToDecimal(from: DataType, target: DecimalType): Any => Any = from match {
         case StringType =>
           buildCast[UTF8String](_, s => try {
    -        changePrecision(Decimal(new JavaBigDecimal(s.toString)), target)
    +        toPrecision(Decimal(new JavaBigDecimal(s.toString)), target)
           } catch {
             case _: NumberFormatException => null
           })
         case BooleanType =>
    -      buildCast[Boolean](_, b => changePrecision(if (b) Decimal.ONE else Decimal.ZERO, target))
    +      buildCast[Boolean](_, b => toPrecision(if (b) Decimal.ONE else Decimal.ZERO, target))
         case DateType =>
           buildCast[Int](_, d => null) // date can't cast to decimal in Hive
         case TimestampType =>
           // Note that we lose precision here.
    -      buildCast[Long](_, t => changePrecision(Decimal(timestampToDouble(t)), target))
    +      buildCast[Long](_, t => toPrecision(Decimal(timestampToDouble(t)), target))
         case dt: DecimalType =>
    -      b => changePrecision(b.asInstanceOf[Decimal].clone(), target)
    --- End diff --
    
    I think this is the only case we need `toPewcision`


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    sorry forgot the trigger the test...


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104234498
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -223,6 +224,18 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       }
     
       /**
    +   * Create new `Decimal` with given precision and scale.
    +   *
    +   * @return `Some(decimal)` if successful or `None` if overflow would occur
    +   */
    +  private[sql] def toPrecision(
    +                     precision: Int, scale: Int,
    --- End diff --
    
    code style...


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103864772
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -362,17 +374,13 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       def abs: Decimal = if (this.compare(Decimal.ZERO) < 0) this.unary_- else this
     
       def floor: Decimal = if (scale == 0) this else {
    -    val value = this.clone()
    -    value.changePrecision(
    -      DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    -    value
    +    toPrecision(DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    +      .getOrElse(clone())
       }
     
       def ceil: Decimal = if (scale == 0) this else {
    -    val value = this.clone()
    -    value.changePrecision(
    -      DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_CEILING)
    -    value
    +    toPrecision(DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_CEILING)
    +      .getOrElse(clone())
    --- End diff --
    
    See my comment above


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by tejasapatil <gi...@git.apache.org>.
Github user tejasapatil commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103598033
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -362,17 +374,13 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       def abs: Decimal = if (this.compare(Decimal.ZERO) < 0) this.unary_- else this
     
       def floor: Decimal = if (scale == 0) this else {
    -    val value = this.clone()
    -    value.changePrecision(
    -      DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    -    value
    +    toPrecision(DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    +      .getOrElse(clone())
       }
     
       def ceil: Decimal = if (scale == 0) this else {
    -    val value = this.clone()
    -    value.changePrecision(
    -      DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_CEILING)
    -    value
    +    toPrecision(DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_CEILING)
    +      .getOrElse(clone())
    --- End diff --
    
    same as above


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103863388
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala ---
    @@ -339,36 +339,34 @@ case class Cast(child: Expression, dataType: DataType, timeZoneId: Option[String
       }
     
       /**
    -   * Change the precision / scale in a given decimal to those set in `decimalType` (if any),
    -   * returning null if it overflows or modifying `value` in-place and returning it if successful.
    +   * Create new `Decimal` with precision and scale given in `decimalType` (if any),
    +   * returning null if it overflows or creating a new `value` and returning it if successful.
        *
    -   * NOTE: this modifies `value` in-place, so don't call it on external data.
        */
    -  private[this] def changePrecision(value: Decimal, decimalType: DecimalType): Decimal = {
    -    if (value.changePrecision(decimalType.precision, decimalType.scale)) value else null
    -  }
    +  private[this] def toPrecision(value: Decimal, decimalType: DecimalType): Decimal =
    +    value.toPrecision(decimalType.precision, decimalType.scale).orNull
     
       private[this] def castToDecimal(from: DataType, target: DecimalType): Any => Any = from match {
         case StringType =>
           buildCast[UTF8String](_, s => try {
    -        changePrecision(Decimal(new JavaBigDecimal(s.toString)), target)
    +        toPrecision(Decimal(new JavaBigDecimal(s.toString)), target)
    --- End diff --
    
    agree


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104351913
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala ---
    @@ -422,3 +434,4 @@ class MathFunctionsSuite extends QueryTest with SharedSQLContext {
         checkAnswer(df.selectExpr("positive(b)"), Row(-1))
       }
     }
    +case class NumericRow(value : BigDecimal)
    --- End diff --
    
    replaced with Tuple1


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    **[Test build #74135 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74135/testReport)** for PR 17075 at commit [`fc0f2d1`](https://github.com/apache/spark/commit/fc0f2d11f60dc1eade4c32d5a56292766061886e).
     * This patch **fails PySpark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104288067
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -223,6 +224,18 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       }
     
       /**
    +   * Create new `Decimal` with given precision and scale.
    +   *
    +   * @return `Some(decimal)` if successful or `None` if overflow would occur
    +   */
    +  private[sql] def toPrecision(
    +                     precision: Int, scale: Int,
    --- End diff --
    
    Fixed, thanks


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    retest this please


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by tejasapatil <gi...@git.apache.org>.
Github user tejasapatil commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103598158
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/types/DecimalSuite.scala ---
    @@ -193,7 +193,7 @@ class DecimalSuite extends SparkFunSuite with PrivateMethodTester {
         assert(Decimal(Long.MaxValue, 100, 0).toUnscaledLong === Long.MaxValue)
       }
     
    -  test("changePrecision() on compact decimal should respect rounding mode") {
    +  test("changePrecision/toPrecission on compact decimal should respect rounding mode") {
    --- End diff --
    
    nit: typo in `toPrecission`


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    thanks, merging to master!


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103588821
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -223,12 +223,24 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       }
     
       /**
    +   * Create new `Decimal` with given precision and scale.
    +   *
    +   * @return `Some(decimal)` if successful or `None` if overflow would occur
    +   */
    +  private[sql] def toPrecision(precision: Int, scale: Int,
    --- End diff --
    
    nit: the style should be
    ```
    def xxx(
        para1: xxx,
       para2: xxx): T = {
    ```


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103588610
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala ---
    @@ -339,36 +339,34 @@ case class Cast(child: Expression, dataType: DataType, timeZoneId: Option[String
       }
     
       /**
    -   * Change the precision / scale in a given decimal to those set in `decimalType` (if any),
    -   * returning null if it overflows or modifying `value` in-place and returning it if successful.
    +   * Create new `Decimal` with precision and scale given in `decimalType` (if any),
    +   * returning null if it overflows or creating a new `value` and returning it if successful.
        *
    -   * NOTE: this modifies `value` in-place, so don't call it on external data.
        */
    -  private[this] def changePrecision(value: Decimal, decimalType: DecimalType): Decimal = {
    -    if (value.changePrecision(decimalType.precision, decimalType.scale)) value else null
    -  }
    +  private[this] def toPrecision(value: Decimal, decimalType: DecimalType): Decimal =
    +    value.toPrecision(decimalType.precision, decimalType.scale).orNull
     
       private[this] def castToDecimal(from: DataType, target: DecimalType): Any => Any = from match {
         case StringType =>
           buildCast[UTF8String](_, s => try {
    -        changePrecision(Decimal(new JavaBigDecimal(s.toString)), target)
    +        toPrecision(Decimal(new JavaBigDecimal(s.toString)), target)
    --- End diff --
    
    Looks like here we don't need to create a new instance?


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103589037
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -362,17 +374,13 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       def abs: Decimal = if (this.compare(Decimal.ZERO) < 0) this.unary_- else this
     
       def floor: Decimal = if (scale == 0) this else {
    -    val value = this.clone()
    -    value.changePrecision(
    -      DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    -    value
    +    toPrecision(DecimalType.bounded(precision - scale + 1, 0).precision, 0, ROUND_FLOOR)
    --- End diff --
    
    shall we assume `toPrecision` will always return Some here?


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    LGTM, pending tests


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    **[Test build #74135 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74135/testReport)** for PR 17075 at commit [`fc0f2d1`](https://github.com/apache/spark/commit/fc0f2d11f60dc1eade4c32d5a56292766061886e).


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    I have just started refactoring of `changePrecission` in order to make it immutable. 
    My idea was to change the signature from:
     `def changePrecision(precision: Int, scale: Int, mode: Int): Boolean`
    into 
     `def changePrecision(precision: Int, scale: Int, mode: Int): Option[Decimal]`
    
     Here are my first thoughts:
    - `org.apache.spark.sql.types.Decimal` is mutable by definition, so making one method immutable makes its contract very inconsistent
    
    - I am afraid of performance degradation in micro-benchmarks since in some use cases, an instance needs to be created twice
    
    - `changePrecission` is called 10 times in Scala, 10 times in **code gen** functions and 3 times in Java **unsafe** writers (`UnsafeArrayWriter`, `UnsafeRowWriter`)
    
    I would be grateful if you could confirm if it's the right way to go.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103864843
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/types/DecimalSuite.scala ---
    @@ -193,7 +193,7 @@ class DecimalSuite extends SparkFunSuite with PrivateMethodTester {
         assert(Decimal(Long.MaxValue, 100, 0).toUnscaledLong === Long.MaxValue)
       }
     
    -  test("changePrecision() on compact decimal should respect rounding mode") {
    +  test("changePrecision/toPrecission on compact decimal should respect rounding mode") {
    --- End diff --
    
    Thanks, fixed


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104287923
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala ---
    @@ -233,6 +233,18 @@ class MathFunctionsSuite extends QueryTest with SharedSQLContext {
         )
       }
     
    +  test("round/bround with data frame from a local Seq of Product") {
    +    val df = spark.createDataFrame(Seq(NumericRow(BigDecimal("5.9"))))
    --- End diff --
    
    Sure, I will try to investigate where is the difference


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    I dont' know the code well enough to really evaluate this, but, I see that `.clone()` is called in a similar context in `decimalExpressions`. There are also similar usages of `changePrecision` in `UnsafeArrayWriter` and `UnsafeRowWriter`; I wonder if they are affected too?
    
    CC maybe @cloud-fan or @yjshen  ?


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    retest this please


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Good idea @cloud-fan. I will look for usages of `changePrecision` then.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103864520
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala ---
    @@ -233,6 +233,18 @@ class MathFunctionsSuite extends QueryTest with SharedSQLContext {
         )
       }
     
    +  test("round/bround with data frame from a local Seq of Product") {
    +    val df = spark.createDataFrame(Seq(NumericRow(BigDecimal("5.9"))))
    --- End diff --
    
    Actually, the problem occurs only when creating data frame from `Product`. Unable to reproduce the issue with `Seq(BigDecimal("5.9")).toDF("value")`


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    **[Test build #74181 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74181/testReport)** for PR 17075 at commit [`fc0f2d1`](https://github.com/apache/spark/commit/fc0f2d11f60dc1eade4c32d5a56292766061886e).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    **[Test build #74152 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74152/testReport)** for PR 17075 at commit [`fc0f2d1`](https://github.com/apache/spark/commit/fc0f2d11f60dc1eade4c32d5a56292766061886e).


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104236324
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala ---
    @@ -233,6 +233,18 @@ class MathFunctionsSuite extends QueryTest with SharedSQLContext {
         )
       }
     
    +  test("round/bround with data frame from a local Seq of Product") {
    +    val df = spark.createDataFrame(Seq(NumericRow(BigDecimal("5.9"))))
    --- End diff --
    
    this is weird, can you look into it? `spark.createDataset(Seq(BigDecimal("5.9")))` should produce the same result.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103863738
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala ---
    @@ -339,36 +339,34 @@ case class Cast(child: Expression, dataType: DataType, timeZoneId: Option[String
       }
     
       /**
    -   * Change the precision / scale in a given decimal to those set in `decimalType` (if any),
    -   * returning null if it overflows or modifying `value` in-place and returning it if successful.
    +   * Create new `Decimal` with precision and scale given in `decimalType` (if any),
    +   * returning null if it overflows or creating a new `value` and returning it if successful.
        *
    -   * NOTE: this modifies `value` in-place, so don't call it on external data.
        */
    -  private[this] def changePrecision(value: Decimal, decimalType: DecimalType): Decimal = {
    -    if (value.changePrecision(decimalType.precision, decimalType.scale)) value else null
    -  }
    +  private[this] def toPrecision(value: Decimal, decimalType: DecimalType): Decimal =
    +    value.toPrecision(decimalType.precision, decimalType.scale).orNull
     
       private[this] def castToDecimal(from: DataType, target: DecimalType): Any => Any = from match {
         case StringType =>
           buildCast[UTF8String](_, s => try {
    -        changePrecision(Decimal(new JavaBigDecimal(s.toString)), target)
    +        toPrecision(Decimal(new JavaBigDecimal(s.toString)), target)
           } catch {
             case _: NumberFormatException => null
           })
         case BooleanType =>
    -      buildCast[Boolean](_, b => changePrecision(if (b) Decimal.ONE else Decimal.ZERO, target))
    +      buildCast[Boolean](_, b => toPrecision(if (b) Decimal.ONE else Decimal.ZERO, target))
         case DateType =>
           buildCast[Int](_, d => null) // date can't cast to decimal in Hive
         case TimestampType =>
           // Note that we lose precision here.
    -      buildCast[Long](_, t => changePrecision(Decimal(timestampToDouble(t)), target))
    +      buildCast[Long](_, t => toPrecision(Decimal(timestampToDouble(t)), target))
         case dt: DecimalType =>
    -      b => changePrecision(b.asInstanceOf[Decimal].clone(), target)
    --- End diff --
    
    Nope, there is one more here:
    
        case BooleanType =>
          buildCast[Boolean](_, b => toPrecision(if (b) Decimal.ONE else Decimal.ZERO, target))
    
    Both, `ONE` and `ZERO` are singletons so changing precision on themselves is not a good idea.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104236016
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala ---
    @@ -233,6 +233,18 @@ class MathFunctionsSuite extends QueryTest with SharedSQLContext {
         )
       }
     
    +  test("round/bround with data frame from a local Seq of Product") {
    +    val df = spark.createDataFrame(Seq(NumericRow(BigDecimal("5.9"))))
    +    checkAnswer(
    +      df.withColumn("value_rounded", round('value)),
    +      Seq(Row(BigDecimal("5.9"), BigDecimal("6")))
    +    )
    +    checkAnswer(
    +      df.withColumn("value_rounded", bround('value)),
    +      Seq(Row(BigDecimal("5.9"), BigDecimal("6")))
    --- End diff --
    
    why test it twice?


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/74186/
    Test FAILed.


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/74152/
    Test FAILed.


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104351867
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -223,6 +224,19 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       }
     
       /**
    +   * Create new `Decimal` with given precision and scale.
    +   *
    +   * @return `Some(decimal)` if successful or `None` if overflow would occur
    +   */
    +  private[sql] def toPrecision(
    --- End diff --
    
    fixed


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104353273
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -223,6 +224,19 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       }
     
       /**
    +   * Create new `Decimal` with given precision and scale.
    +   *
    +   * @return `Some(decimal)` if successful or `None` if overflow would occur
    +   */
    +  private[sql] def toPrecision(
    +                   precision: Int,
    --- End diff --
    
    4 spaces indention here. please take a look at other methods in spark and follow the code style.


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Merged build finished. Test FAILed.


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    retest this please


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r103863771
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala ---
    @@ -223,12 +223,24 @@ final class Decimal extends Ordered[Decimal] with Serializable {
       }
     
       /**
    +   * Create new `Decimal` with given precision and scale.
    +   *
    +   * @return `Some(decimal)` if successful or `None` if overflow would occur
    +   */
    +  private[sql] def toPrecision(precision: Int, scale: Int,
    --- End diff --
    
    Fixed, thanks


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


[GitHub] spark pull request #17075: [SPARK-19727][SQL] Fix for round function that mo...

Posted by wojtek-szymanski <gi...@git.apache.org>.
Github user wojtek-szymanski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17075#discussion_r104288088
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala ---
    @@ -233,6 +233,18 @@ class MathFunctionsSuite extends QueryTest with SharedSQLContext {
         )
       }
     
    +  test("round/bround with data frame from a local Seq of Product") {
    +    val df = spark.createDataFrame(Seq(NumericRow(BigDecimal("5.9"))))
    +    checkAnswer(
    +      df.withColumn("value_rounded", round('value)),
    +      Seq(Row(BigDecimal("5.9"), BigDecimal("6")))
    +    )
    +    checkAnswer(
    +      df.withColumn("value_rounded", bround('value)),
    +      Seq(Row(BigDecimal("5.9"), BigDecimal("6")))
    --- End diff --
    
    bround function is also affected. Column `value_rounded` renamed to `value_brounded`


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    **[Test build #74195 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74195/testReport)** for PR 17075 at commit [`fc0f2d1`](https://github.com/apache/spark/commit/fc0f2d11f60dc1eade4c32d5a56292766061886e).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    I think we should fix `changePrecison` to return a new instance instead of updating itself.


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    **[Test build #74152 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74152/testReport)** for PR 17075 at commit [`fc0f2d1`](https://github.com/apache/spark/commit/fc0f2d11f60dc1eade4c32d5a56292766061886e).
     * This patch **fails PySpark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    **[Test build #74186 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74186/testReport)** for PR 17075 at commit [`fc0f2d1`](https://github.com/apache/spark/commit/fc0f2d11f60dc1eade4c32d5a56292766061886e).


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    Can one of the admins verify this patch?


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


[GitHub] spark issue #17075: [SPARK-19727][SQL] Fix for round function that modifies ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17075
  
    **[Test build #74195 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74195/testReport)** for PR 17075 at commit [`fc0f2d1`](https://github.com/apache/spark/commit/fc0f2d11f60dc1eade4c32d5a56292766061886e).


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