Uh oh!
There was an error while loading. Please reload this page.
[SPARK-28201][SQL][TEST][FOLLOWUP] Fix Integration test suite according to the new exception message - #25165
[SPARK-28201][SQL][TEST][FOLLOWUP] Fix Integration test suite according to the new exception message#25165dongjoon-hyun wants to merge 2 commits into
Conversation
…rding to the new exception message
dongjoon-hyun
commented
Jul 15, 2019
cc @mgaido91 and @cloud-fan |
For reviewers, I'm using |
mgaido91
left a comment
There was a problem hiding this comment.
LGTM, just left a personal consideration
| } | ||
| assert(e.getMessage.contains( | ||
| "requirement failed: Decimal precision 39 exceeds max precision 38")) | ||
| assert(e.getMessage.contains("Decimal precision 39 exceeds max precision 38")) |
There was a problem hiding this comment.
as a very nit, I'd rather check the exception type, which I think is more important than the exact message. Now we should be coherent in the whole codebase and always throw an ArithmeticException, while previously we were sometimes throwing RuntimeException or others for the same case.
There was a problem hiding this comment.
Thank you for review, @mgaido91 .
Sure, of course, we can check the underlying exception type by e.getCause from SparkException additionally. I'll add that.
BTW, message checking is a more fine-grained verification. As you know, ArithmeticException and ParseException are not specific. For example, ArithmeticException can be caused by divide by zero. We should check the error message always.
SparkQA
commented
Jul 15, 2019
Test build #107698 has finished for PR 25165 at commit
|
SparkQA
commented
Jul 15, 2019
Test build #107702 has finished for PR 25165 at commit
|
cloud-fan
commented
Jul 16, 2019
thanks, merging to master! |
dongjoon-hyun
commented
Jul 16, 2019
Thank you, @cloud-fan and @mgaido91 ! |
…ng to the new exception message ## What changes were proposed in this pull request? apache#25010 breaks the integration test suite due to the changing the user-facing exception like the following. This PR fixes the integration test suite. ```scala - require( - decimalVal.precision <= precision, - s"Decimal precision ${decimalVal.precision} exceeds max precision $precision") + if (decimalVal.precision > precision) { + throw new ArithmeticException( + s"Decimal precision ${decimalVal.precision} exceeds max precision $precision") + } ``` ## How was this patch tested? Manual test. ``` $ build/mvn install -DskipTests $ build/mvn -Pdocker-integration-tests -pl :spark-docker-integration-tests_2.12 test ``` Closesapache#25165 from dongjoon-hyun/SPARK-28201. Authored-by: Dongjoon Hyun <dhyun@apple.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
#25010 breaks the integration test suite due to the changing the user-facing exception like the following. This PR fixes the integration test suite.
How was this patch tested?
Manual test.