RaleSapic opened a new pull request, #48397: URL: https://github.com/apache/spark/pull/48397
### What changes were proposed in this pull request? In this PR, I introduced new exception to be thrown when there is a mismatch between type of the elements in the array column type, and the actual values of that column. Currently, this can happen in Postgres SQL when type of a column is real[] (array of floats), and insert command provides real[][] (array of arrays of floats). In our case, we are letting this to be converted to Spark SQL Types, and fail when trying to read it later. This PR is catching currently thrown internal exception (java.lang.ClassCastException) and re-throw a newly-introduced exception for this problem. ### Why are the changes needed? Throwing better exception that will help Spark user to better understand why the query failed. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existing, and newly-added unit tests for Postgres. ### Was this patch authored or co-authored using generative AI tooling? No -- 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]
