MaxGekk opened a new pull request, #36247:
URL: https://github.com/apache/spark/pull/36247

   ### What changes were proposed in this pull request?
   In the PR, I propose to upper case SQL types in error messages similar to 
the SQL standard. I added new util functions `toSQLType()` to the trait 
`QueryErrorsBase`, and applied it in `Query.*Errors` (also modified tests in 
`Query.*ErrorsSuite`). For example:
   
   Before:
   ```sql
   Cannot up cast b.`b` from decimal(38,18) to bigint.
   ```
   
   After:
   ```sql
   Cannot up cast b.`b` from DECIMAL(38,18) to BIGINT.
   ```
   
   ### Why are the changes needed?
   To improve user experience with Spark SQL. The changes highlight SQL types 
in error massages and make them more visible for users. 
   
   ### Does this PR introduce _any_ user-facing change?
   No since error classes haven't been released yet.
   
   ### How was this patch tested?
   By running the modified test suites:
   ```
   $ build/sbt "test:testOnly *QueryParsingErrorsSuite"
   $ build/sbt "test:testOnly *QueryCompilationErrorsSuite"
   $ build/sbt "test:testOnly *QueryExecutionErrorsSuite"
   $ build/sbt "testOnly *CastSuite"
   $ build/sbt "testOnly *AnsiCastSuiteWithAnsiModeOn"
   $ build/sbt "testOnly *EncoderResolutionSuite"
   $ build/sbt "test:testOnly *DatasetSuite"
   $ build/sbt "test:testOnly *InsertSuite"
   ```
   
   Authored-by: Max Gekk <[email protected]>
   Signed-off-by: Max Gekk <[email protected]>
   (cherry picked from commit 0d16159bfa85ed346843e0952f37922a579c011e)
   Signed-off-by: Max Gekk <[email protected]>


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