Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/6725#discussion_r32375290
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/MathFunctionsSuite.scala
---
@@ -204,4 +204,22 @@ class MathFunctionsSuite extends SparkFunSuite with
ExpressionEvalHelper {
testBinary(Atan2, math.atan2)
}
+ test("binary log") {
+ val f = (c1: Double, c2: Double) => math.log(c2) / math.log(c1)
+ val domain = (1 to 20).map(v => (v * 0.1, v * 0.2))
+
+ domain.foreach { case (v1, v2) =>
+ checkEvaluation(Logarithm(Literal(v1), Literal(v2)), f(v1 + 0.0, v2
+ 0.0), EmptyRow)
+ checkEvaluation(Logarithm(Literal(v2), Literal(v1)), f(v2 + 0.0, v1
+ 0.0), EmptyRow)
+ }
+ // When base is null, Logarithm is 10-based log.
--- End diff --
If so, we should not support the default 10 based logarithm? Since it is
suggested by @rxin, how do you think?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]