asmello commented on issue #23879: [SPARK-26979][SQL] Add missing column name 
support for SQL functions
URL: https://github.com/apache/spark/pull/23879#issuecomment-466764168
 
 
   I'm very sure, because the general coding pattern used for most functions is
   
   ```
   @since(X.Y)
   def function_name(col):
       """
       Documentation
       """
       sc = SparkContext._active_spark_context
       return Column(sc._jvm.functions.function_name(_to_java_column(col)))
   ```
   
   The exceptions are those who are defined automatically from their name with 
`_create_function()`, and of those only those four functions (`lower()`, 
`upper()`, `abs()`, `bitwiseNOT()`) have no string support on the JVM side.
   
   So unless there's a very sneaky definition somewhere, I don't think any 
other inconsistencies exist.
   
   > Good Python API explicitly expects what as input and what as output. 
Duck-typing is orthogonal here.
   
   I believe this is something that should be made very clear by the 
documentation, but otherwise I don't see a problem. The built-in functions 
themselves are full with examples of duck-typing like this. See `max()`, 
`dict()`, `range()` just to name a few.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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