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

    https://github.com/apache/spark/pull/7925#discussion_r36275714
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/parquet/ParquetQuerySuite.scala ---
    @@ -189,4 +189,17 @@ class ParquetQuerySuite extends QueryTest with 
ParquetTest {
           }
         }
       }
    +
    +  test("SPARK-9119 Decimal should be correctly written into parquet") {
    +    withTempPath { dir =>
    +      val basePath = dir.getCanonicalPath
    +      val schema = StructType(Array(StructField("name", DecimalType(10, 
5), false)))
    +      val rowRDD = 
sqlContext.sparkContext.parallelize(Array(Row(Decimal("67123.45"))))
    +      val df = sqlContext.createDataFrame(rowRDD, schema)
    +      df.write.parquet(basePath)
    +
    +      val decimal = sqlContext.read.parquet(basePath).first().getDecimal(0)
    +      assert(Decimal("67123.45") === Decimal(decimal))
    --- End diff --
    
    When we compare Decimal, the zero on the most right does not matter. If we 
compare them as java.math.BigDecimal, it matters.


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