Github user brkyvz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5750#discussion_r29306904
  
    --- Diff: python/pyspark/sql/functions.py ---
    @@ -33,17 +33,36 @@
     __all__ = ['countDistinct', 'approxCountDistinct', 'udf']
     
     
    -def _create_function(name, doc=""):
    +def _function_obj(sc, is_math=False):
    +    if not is_math:
    +        return sc._jvm.functions
    +    else:
    +        return sc._jvm.mathfunctions
    +
    +
    +def _create_function(name, doc="", is_math=False, binary=False):
    --- End diff --
    
    I did... The problem is, I can't pass in `sc` when it was outside this 
function. I guess the problem was globally calling `sc = 
SparkContext._active_spark_context`, meaning outside of a function. That's why 
I had to have this hack.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to