You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "huangxiaopingRD (via GitHub)" <gi...@apache.org> on 2026/01/09 06:49:56 UTC
[PR] [SPARK-54980][SQL] Convert the JDBC isolation level to a string [spark]
huangxiaopingRD opened a new pull request, #53745:
URL: https://github.com/apache/spark/pull/53745
### What changes were proposed in this pull request?
Convert the JDBC isolation level to a string.
### Why are the changes needed?
Improve log readability.
**Before:**
```
26/01/07 00:25:50 WARN [Executor task launch worker for task 0.0 in stage 1.0 (TID 1)] JdbcUtils: Requested isolation level 1, but transactions are unsupported
```
**After:**
```
26/01/09 11:29:07 WARN [Executor task launch worker for task 0.0 in stage 1.0 (TID 1)] JdbcUtils: Requested isolation level READ_UNCOMMITTED, but transactions are unsupported
```
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
No
### Was this patch authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54980][SQL] Convert the JDBC isolation level to a string [spark]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #53745:
URL: https://github.com/apache/spark/pull/53745#issuecomment-3727455373
## JIRA Issue Information
=== Improvement SPARK-54980 ===
Summary: Convert the JDBC isolation level to a string
Assignee: None
Status: Open
Affected: ["4.2.0"]
---
*This comment was automatically generated by GitHub Actions*
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54980][SQL] Convert the JDBC isolation level to a string [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #53745:
URL: https://github.com/apache/spark/pull/53745#issuecomment-3759688015
Merged to master
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54980][SQL] Convert the JDBC isolation level to a string [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #53745:
URL: https://github.com/apache/spark/pull/53745#discussion_r2693511147
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala:
##########
@@ -915,6 +917,20 @@ object JdbcUtils extends Logging with SQLConfHelper {
}
}
+ /**
+ * Convert the value of isolation level to string.
+ */
+ def isolationLevelSting(isolationLevel: Int): String = {
Review Comment:
2 typos:
- isolationLevelString
- private def
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54980][SQL] Convert the JDBC isolation level to a string [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #53745:
URL: https://github.com/apache/spark/pull/53745#discussion_r2676708754
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala:
##########
@@ -915,6 +917,21 @@ object JdbcUtils extends Logging with SQLConfHelper {
}
}
+ /**
+ * Convert the value of isolation level to string.
+ */
+ def isolationLevelSting(isolationLevel: Int): String = {
+ isolationLevel match {
+ case Connection.TRANSACTION_NONE => "NONE"
+ case Connection.TRANSACTION_READ_UNCOMMITTED => "READ_UNCOMMITTED"
+ case Connection.TRANSACTION_READ_COMMITTED => "READ_COMMITTED"
+ case Connection.TRANSACTION_REPEATABLE_READ => "REPEATABLE_READ"
+ case Connection.TRANSACTION_SERIALIZABLE => "SERIALIZABLE"
+ case value =>
+ throw QueryExecutionErrors.invalidJdbcTxnIsolationLevelNumberError(value.toString)
Review Comment:
How about return value directly instead of introducing a potential breaking change
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54980][SQL] Convert the JDBC isolation level to a string [spark]
Posted by "huangxiaopingRD (via GitHub)" <gi...@apache.org>.
huangxiaopingRD commented on code in PR #53745:
URL: https://github.com/apache/spark/pull/53745#discussion_r2679229992
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala:
##########
@@ -915,6 +917,21 @@ object JdbcUtils extends Logging with SQLConfHelper {
}
}
+ /**
+ * Convert the value of isolation level to string.
+ */
+ def isolationLevelSting(isolationLevel: Int): String = {
+ isolationLevel match {
+ case Connection.TRANSACTION_NONE => "NONE"
+ case Connection.TRANSACTION_READ_UNCOMMITTED => "READ_UNCOMMITTED"
+ case Connection.TRANSACTION_READ_COMMITTED => "READ_COMMITTED"
+ case Connection.TRANSACTION_REPEATABLE_READ => "REPEATABLE_READ"
+ case Connection.TRANSACTION_SERIALIZABLE => "SERIALIZABLE"
+ case value =>
+ throw QueryExecutionErrors.invalidJdbcTxnIsolationLevelNumberError(value.toString)
Review Comment:
This seems more reasonable. Thank you for your review. I have updated it according to your suggestion.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-54980][SQL] Convert the JDBC isolation level to a string [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn closed pull request #53745: [SPARK-54980][SQL] Convert the JDBC isolation level to a string
URL: https://github.com/apache/spark/pull/53745
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org