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

   ### What changes were proposed in this pull request?
   In the PR, I propose to wrap any SQL statement in error messages by double 
quotes "", and apply new implementation of `QueryErrorsBase.toSQLStmt()` to all 
exceptions in `Query.*Errors` w/ error classes. Also this PR modifies all 
affected tests, see the list in the section "How was this patch tested?".
   
   ### Why are the changes needed?
   To improve user experience with Spark SQL by highlighting SQL statements in 
error massage and make them more visible to users.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. The changes might influence on error messages that are visible to users.
   
   Before:
   ```sql
   The operation DESC PARTITION is not allowed
   ```
   
   After:
   ```sql
   The operation "DESC PARTITION" is not allowed
   ```
   
   ### How was this patch tested?
   By running affected test suites:
   ```
   $ build/sbt "sql/testOnly *QueryExecutionErrorsSuite"
   $ build/sbt "sql/testOnly *QueryParsingErrorsSuite"
   $ build/sbt "sql/testOnly *QueryCompilationErrorsSuite"
   $ build/sbt "test:testOnly *QueryCompilationErrorsDSv2Suite"
   $ build/sbt "test:testOnly *ExtractPythonUDFFromJoinConditionSuite"
   $ build/sbt "testOnly *PlanParserSuite"
   $ build/sbt "sql/testOnly *SQLQueryTestSuite -- -z transform.sql"
   $ build/sbt "sql/testOnly *SQLQueryTestSuite -- -z join-lateral.sql"
   $ build/sbt "sql/testOnly *SQLQueryTestSuite -- -z describe.sql"
   ```
   
   Authored-by: Max Gekk <[email protected]>
   Signed-off-by: Max Gekk <[email protected]>
   (cherry picked from commit 5aba2b38beae6e1baf6f0c6f9eb3b65cf607fe77)
   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