SEPURI-SAI-KRISHNA commented on code in PR #59160:
URL: https://github.com/apache/spark/pull/59160#discussion_r4218269037


##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala:
##########
@@ -2575,6 +2575,29 @@ class JDBCSuite extends SharedSparkSession {
       specifiedPrecision, null) == Some(DecimalType.SYSTEM_DEFAULT))
   }
 
+  test("SPARK-59891: TeradataDialect classifies only syntax error codes as 
syntax errors") {

Review Comment:
   Thanks for taking a look. There's no Teradata docker image we could use: 
Vantage Express only ships as a VM image behind a Teradata account login, which 
is also why docker-integration-tests has no Teradata suite.
   
   Agreed that the test was mostly restating the logic. One thing that helps 
here: the Teradata server doesn't send a SQLSTATE at all, the JDBC driver 
derives it on the client from the error code. `terajdbc` is already a test 
dependency of sql/core, so I changed the test to build the exceptions with the 
driver's own `ErrorFactory.makeDatabaseSQLException`, which is what the driver 
uses for errors returned by the database, instead of hand-written 
`SQLException`s. It now checks the dialect against what the driver actually 
throws, including that access errors like 3523/3524 come with the same `42000` 
as syntax errors. With the old `startsWith("42")` check it fails on 3523.
   



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