Github user mateiz commented on a diff in the pull request:
https://github.com/apache/spark/pull/2983#discussion_r19697753
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/parquet/ParquetQuerySuite.scala ---
@@ -869,4 +871,35 @@ class ParquetQuerySuite extends QueryTest with
FunSuiteLike with BeforeAndAfterA
assert(a.dataType === b.dataType)
}
}
+
+ test("read/write fixed-length decimals") {
+ for ((precision, scale) <- Seq((5, 2), (1, 0), (1, 1), (18, 10), (18,
17))) {
+ val tempDir = getTempFilePath("parquetTest").getCanonicalPath
+ val data = sparkContext.parallelize(0 to 1000)
+ .map(i => NumericData(i, i / 100.0))
+ .select('i, 'd cast DecimalType(precision, scale))
+ data.saveAsParquetFile(tempDir)
+ checkAnswer(parquetFile(tempDir), data.toSchemaRDD.collect().toSeq)
+ }
+
+ // Decimals with precision above 18 are not yet supported
--- End diff --
Alright, will open one
---
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]