HyukjinKwon commented on issue #23882: [SPARK-26979][PYTHON] Add missing string 
column name support for some SQL functions
URL: https://github.com/apache/spark/pull/23882#issuecomment-473740180
 
 
   What happened to math functions?
   
   ```python
   >>> from pyspark.sql.functions import atan2
   >>> spark.range(1).select(atan2("id", "id"))
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/.../spark/python/pyspark/sql/functions.py", line 78, in _
       jc = getattr(sc._jvm.functions, name)(col1._jc if isinstance(col1, 
Column) else float(col1),
   ValueError: could not convert string to float: id
   ```
   
   ```python
   >>> from pyspark.sql.functions import atan2, col
   >>> spark.range(1).select(atan2(col("id"), col("id")))
   DataFrame[ATAN2(id, id): double]
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to