GitHub user MaxGekk opened a pull request: https://github.com/apache/spark/pull/21410
[SPARK-24366][SQL] Improving of error messages for type converting ## What changes were proposed in this pull request? Currently, users are getting the following error messages on type conversions: ``` scala.MatchError: test (of class java.lang.String) ``` The message doesn't give any clues to the users where in the schema the error happened. In this PR, I would like to improve the error message like: ``` The value (test) of the type (java.lang.String) cannot be converted to struct<f1:int> ``` ## How was this patch tested? Added tests for converting of wrong values to `struct`, `map`, `array`, `string` and `decimal`. You can merge this pull request into a Git repository by running: $ git pull https://github.com/MaxGekk/spark-1 type-conv-error Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/21410.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 #21410 ---- commit 26cc2f84ee6324db23936e20816d240031211311 Author: Maxim Gekk <maxim.gekk@...> Date: 2018-05-23T12:22:33Z Improving of error messages for type conversions ---- --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org