-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KYUUBI #670] KyuubiSQLException support sqlState and errorCode #674
Conversation
Codecov Report
@@ Coverage Diff @@
## master #674 +/- ##
==========================================
+ Coverage 80.10% 80.41% +0.30%
==========================================
Files 120 120
Lines 4709 4717 +8
Branches 572 573 +1
==========================================
+ Hits 3772 3793 +21
+ Misses 611 601 -10
+ Partials 326 323 -3
Continue to review full report at Codecov.
|
kyuubi-common/src/main/scala/org/apache/kyuubi/KyuubiSQLException.scala
Outdated
Show resolved
Hide resolved
kyuubi-common/src/main/scala/org/apache/kyuubi/KyuubiException.scala
Outdated
Show resolved
Hide resolved
* (which is saved for later retrieval by the `getCause()` method); | ||
* may be null indicating the cause is non-existent or unknown. | ||
*/ | ||
class KyuubiSQLException(msg: String, cause: Throwable, sqlState: String, errorCode: Int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the constructor paras order is not the same with SQLException and the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will align SQLException
def apply(msg: String, | ||
cause: Throwable = null, | ||
sqlState: String = null, | ||
errorCode: Int = 0): KyuubiSQLException = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe venderCode is more accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ident
msg: String, | ||
cause: Throwable = null, | ||
sqlState: String = null, | ||
vendorCode: Int = 0): KyuubiSQLException = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reorder the parameters to simplify method overwrite
msg: String, | ||
cause: Throwable = null, | ||
sqlState: String = null, | ||
vendorCode: Int = 0): KyuubiSQLException = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vendorCode: Int = 0
Why we use 0
as the default code, seems 0
is success. use -1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm, SQLException
also use 0 ..
thanks, merging to master for v1.3.0 |
Why are the changes needed?
#670
How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before make a pull request