MaxGekk commented on code in PR #36169:
URL: https://github.com/apache/spark/pull/36169#discussion_r849650320


##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala:
##########
@@ -278,4 +284,35 @@ class QueryExecutionErrorsSuite extends QueryTest
     assert(e.getMessage ===
       "Datetime operation overflow: add 1000000 YEAR to TIMESTAMP '2022-03-09 
01:02:03'.")
   }
+
+  test("CANNOT_PARSE_DECIMAL: unparseable decimal") {
+    val e1 = intercept[SparkException] {
+      val schema = new StructType().add("money", DecimalType.DoubleDecimal)
+      spark
+        .read
+        .schema(schema)
+        .format("csv")
+        .option("header", "true")
+        .option("locale", Locale.ROOT.toLanguageTag)
+        .option("multiLine", "true")
+        .option("inferSchema", "false")
+        .option("mode", "FAILFAST")

Review Comment:
   Just wonder, is it possible to use the `from_csv` function? If so, we could 
avoid access to the file system.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to