Skip to content

Commit ab51542

Browse files
committed
Use JVM log
1 parent 76fc8de commit ab51542

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/pyspark/sql/functions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,11 @@ def log(arg1, arg2=None):
416416
>>> df.select(log(df.age).alias('e')).map(lambda l: str(l.e)[:7]).collect()
417417
['0.69314', '1.60943']
418418
"""
419-
if arg2 is None:
420-
arg2 = arg1
421-
arg1 = math.e
422419
sc = SparkContext._active_spark_context
423-
jc = sc._jvm.functions.log(arg1, _to_java_column(arg2))
420+
if arg2 is None:
421+
jc = sc._jvm.functions.log(_to_java_column(arg1))
422+
else:
423+
jc = sc._jvm.functions.log(arg1, _to_java_column(arg2))
424424
return Column(jc)
425425

426426

0 commit comments

Comments
 (0)