urosstan-db commented on code in PR #52421:
URL: https://github.com/apache/spark/pull/52421#discussion_r2373011161
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala:
##########
@@ -308,7 +311,10 @@ class JDBCRDD(
case e: SQLException if dialect.isSyntaxErrorBestEffort(e) =>
throw new SparkException(
errorClass =
"JDBC_EXTERNAL_ENGINE_SYNTAX_ERROR.DURING_QUERY_EXECUTION",
- messageParameters = Map("jdbcQuery" -> sqlText),
+ messageParameters = Map(
+ "jdbcQuery" -> sqlText,
+ "externalEngineQuery" -> e.getMessage.replaceAll("\\.+$", "")
Review Comment:
Good catch, done
##########
connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/SharedJDBCIntegrationTests.scala:
##########
@@ -30,5 +30,13 @@ trait SharedJDBCIntegrationTests extends QueryTest {
.option("query", "THIS IS NOT VALID SQL").load()
}
assert(e.getCondition.startsWith("JDBC_EXTERNAL_ENGINE_SYNTAX_ERROR"))
+ checkErrorMatchPVals(
+ e,
+ condition =
"JDBC_EXTERNAL_ENGINE_SYNTAX_ERROR.DURING_OUTPUT_SCHEMA_RESOLUTION",
+ parameters = Map(
+ "jdbcQuery" -> "SELECT * FROM \\(.*",
+ "externalEngineQuery" -> ".*"
Review Comment:
Good catch, done
--
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]