Skip to content

Commit db7dc38

Browse files
committed
Use ctor instead of companion object.
1 parent 0634ef7 commit db7dc38

File tree

1 file changed

+5
-4
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions

1 file changed

+5
-4
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/math.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,17 +266,18 @@ case class Pow(left: Expression, right: Expression)
266266
}
267267
}
268268

269-
object Logarithm {
270-
def apply(child: Expression): Expression = new Log(child)
271-
}
272-
273269
case class Logarithm(left: Expression, right: Expression)
274270
extends AbstractBinaryMathExpression[Double, Double, Double]("LOG") {
271+
def this(child: Expression) = {
272+
this(Literal(math.E), child)
273+
}
274+
275275
override def expectedChildTypes: Seq[DataType] = Seq(DoubleType, DoubleType)
276276
override def dataType: DataType = DoubleType
277277

278278
def base: Expression = left
279279
def value: Expression = right
280+
280281
override def eval(input: InternalRow): Any = {
281282
val evalE2 = value.eval(input)
282283
if (evalE2 == null) {

0 commit comments

Comments
 (0)