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-473743049
 
 
   Math cases are difficult to fix because of the existing support:
   
   ```python
   def _create_binary_mathfunction(name, doc=""):
       """ Create a binary mathfunction by name"""
       def _(col1, col2):
           sc = SparkContext._active_spark_context
           # users might write ints for simplicity. This would throw an error 
on the JVM side.
           jc = getattr(sc._jvm.functions, name)(col1._jc if isinstance(col1, 
Column) else float(col1),
                                                 col2._jc if isinstance(col2, 
Column) else float(col2))
   ```
   
   Therefore, if `col1` argument is a string number, for instance, `"1"` but 
also can be a name of the column. Here's the ambiguity. Since we're going ahead 
for Spark 3.0, I am going to disallow string as numbers in a followup.

----------------------------------------------------------------
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