-
Notifications
You must be signed in to change notification settings - Fork 232
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
Make the error message of changing decimal type the same as Spark's [databricks] #5915
Make the error message of changing decimal type the same as Spark's [databricks] #5915
Conversation
Signed-off-by: remzi <13716567376yh@gmail.com>
build |
CI error: https://github.com/NVIDIA/spark-rapids/runs/7067135922?check_suite_focus=true#step:2:5245, |
build |
fromType: DecimalType, | ||
toType: DecimalType, | ||
context: String = ""): ArithmeticException = { | ||
val row_id = withResource(outOfBounds.copyToHost()) {hcv => |
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.
My only real nit is that there is a lot of copy and paste between the 4 implementations of this code. Is there a ways we can make this more common?
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.
Yes, I can extra some common expressions to be a new helper function. But I am not sure where to put the helper.
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.
Only GpuCeil and GpuFloor do this. I would create a trait or an object in mathExpressions.scala and name it something like FloorCeilErrorUtil or RoundingErrorUtil and add it there.
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.
Updated!
build |
Signed-off-by: remzi <13716567376yh@gmail.com>
build |
The failure seems not related to this PR: https://github.com/NVIDIA/spark-rapids/runs/7124317772?check_suite_focus=true#step:2:34524 |
@revans2 Please have a look. Thank you! |
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.
Looks like there is a type in one of the files.
|
||
object RapidsErrorUtils { | ||
object RapidsErrorUtils extends { |
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.
Why is there an "extends" here that is not used?
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.
Updated!
sql-plugin/src/main/321db/scala/org/apache/spark/sql/rapids/shims/RapidsErrorUtils.scala
Outdated
Show resolved
Hide resolved
…ims/RapidsErrorUtils.scala
build |
1 similar comment
build |
The failure test is not related to this PR. https://github.com/NVIDIA/spark-rapids/runs/7159690760?check_suite_focus=true#step:2:34528 |
Looks like the issue for this failure is #5937 I am inclined to let this PR wait until the issue is resolved, but if others have a different option I can admin merge it. |
build |
1 similar comment
build |
Signed-off-by: remzi 13716567376yh@gmail.com
Related to #5196.
Rationale for this change
We want to throw the same error message as Spark.
Changes in this PR.
cannotChangeDecimalPrecisionError
to find which value causes the error, so that we could throw the same error message as Spark.update_test_floor_ceil_overflow
to check the error message more precisely.java.lang.ArithmeticException
before Spark 3.3.0 andSparkArithmeticException
after 330). The content of error message is not checked because I don't find a good way to get the value ofdata_gen