Skip to content

Commit 21c3bfd

Browse files
committed
Fix scala style.
1 parent c6c187f commit 21c3bfd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

python/pyspark/sql/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def _():
144144
'polar coordinates (r, theta).',
145145
'hypot': 'Computes `sqrt(a^2^ + b^2^)` without intermediate overflow or underflow.',
146146
'pow': 'Returns the value of the first argument raised to the power of the second argument.',
147-
'logarithm': 'Returns the first argument-based logarithm of the second argument',
147+
'log': 'Returns the first argument-based logarithm of the second argument',
148148
}
149149

150150
_window_functions = {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ case class Pow(left: Expression, right: Expression)
204204
}
205205

206206
object Logarithm {
207-
def apply(exprs: Seq[Expression]) = {
207+
def apply(exprs: Seq[Expression]): Expression = {
208208
if (exprs.length == 1) {
209209
new Log(exprs(0))
210210
} else if (exprs.length == 2) {
@@ -213,7 +213,7 @@ object Logarithm {
213213
sys.error(s"Log only accepts two input expressions")
214214
}
215215
}
216-
def apply(child: Expression) = new Log(child)
216+
def apply(child: Expression): Expression = new Log(child)
217217
}
218218

219219
case class Logarithm(left: Expression, right: Expression)

sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class DataFrameFunctionsSuite extends QueryTest {
9696
checkAnswer(
9797
df.select(org.apache.spark.sql.functions.log("a"),
9898
org.apache.spark.sql.functions.log(2.0, "a"),
99-
org.apache.spark.sql.functions.log("b")), Row(math.log(123), math.log(123) / math.log(2), null))
99+
org.apache.spark.sql.functions.log("b")),
100+
Row(math.log(123), math.log(123) / math.log(2), null))
100101
}
101102
}

0 commit comments

Comments
 (0)