-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-29096][SQL] The exact math method should be called only when there is a corresponding function in Math #25804
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ import java.util.{Locale, TimeZone} | |
|
|
||
| import scala.util.control.NonFatal | ||
|
|
||
| import org.apache.spark.SparkException | ||
| import org.apache.spark.sql.catalyst.planning.PhysicalOperation | ||
| import org.apache.spark.sql.catalyst.plans.logical._ | ||
| import org.apache.spark.sql.catalyst.plans.logical.sql.{DescribeColumnStatement, DescribeTableStatement} | ||
|
|
@@ -308,6 +309,7 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession { | |
| localSparkSession.conf.set(SQLConf.CROSS_JOINS_ENABLED.key, true) | ||
| localSparkSession.conf.set(SQLConf.ANSI_SQL_PARSER.key, true) | ||
| localSparkSession.conf.set(SQLConf.PREFER_INTEGRAL_DIVISION.key, true) | ||
| localSparkSession.conf.set(SQLConf.FAIL_ON_INTEGRAL_TYPE_OVERFLOW.key, true) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of setting it always to true, I think we should set it to both true and false in the tests which are relevant.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer to enable it for all pgSQL tests:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in this way we are running all our tests only in one of the two modes (the non-default one moreover), so we are not ensuring the behavior on both modes. I don't think this is a good idea. I think that when we will have the ANSI feature, we will run these tests both with ANSI enabled and not. Otherwise we would not provide proper coverage.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sense. I think the cause of the issue is test coverage. |
||
| case _ => | ||
| } | ||
|
|
||
|
|
@@ -413,6 +415,9 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession { | |
| // with a generic pattern "###". | ||
| val msg = if (a.plan.nonEmpty) a.getSimpleMessage else a.getMessage | ||
| (StructType(Seq.empty), Seq(a.getClass.getName, msg.replaceAll("#\\d+", "#x"))) | ||
| case s: SparkException => | ||
| val cause = s.getCause | ||
| (StructType(Seq.empty), Seq(cause.getClass.getName, cause.getMessage)) | ||
| case NonFatal(e) => | ||
| // If there is an exception, put the exception class followed by the message. | ||
| (StructType(Seq.empty), Seq(e.getClass.getName, e.getMessage)) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.