3232
3333__all__ = ['countDistinct' , 'approxCountDistinct' , 'udf' ]
3434
35+
3536def _function_obj (sc , is_math = False ):
3637 if not is_math :
3738 return sc ._jvm .functions
3839 else :
3940 return sc ._jvm .mathfunctions
4041
42+
4143def _create_function (name , doc = "" , is_math = False ):
4244 """ Create a function for aggregator by name"""
4345 def _ (col ):
@@ -73,12 +75,12 @@ def _(col):
7375
7476# math functions are found under another object therefore, they need to be handled separately
7577_math_functions = {
76- 'acos' : 'Computes the cosine inverse of the given value; the returned angle is in the range' + \
78+ 'acos' : 'Computes the cosine inverse of the given value; the returned angle is in the range' +
7779 '0.0 through pi.' ,
78- 'asin' : 'Computes the sine inverse of the given value; the returned angle is in the range' + \
80+ 'asin' : 'Computes the sine inverse of the given value; the returned angle is in the range' +
7981 '-pi/2 through pi/2.' ,
8082 'atan' : 'Computes the tangent inverse of the given value.' ,
81- 'atan2' : 'Returns the angle theta from the conversion of rectangular coordinates (x, y) to' + \
83+ 'atan2' : 'Returns the angle theta from the conversion of rectangular coordinates (x, y) to' +
8284 'polar coordinates (r, theta).' ,
8385 'cbrt' : 'Computes the cube-root of the given value.' ,
8486 'ceil' : 'Computes the ceiling of the given value.' ,
@@ -92,16 +94,16 @@ def _(col):
9294 'log10' : 'Computes the logarithm of the given value in Base 10.' ,
9395 'log1p' : 'Computes the natural logarithm of the given value plus one.' ,
9496 'pow' : 'Returns the value of the first argument raised to the power of the second argument.' ,
95- 'rint' : 'Returns the double value that is closest in value to the argument and' + \
97+ 'rint' : 'Returns the double value that is closest in value to the argument and' +
9698 ' is equal to a mathematical integer.' ,
9799 'signum' : 'Computes the signum of the given value.' ,
98100 'sin' : 'Computes the sine of the given value.' ,
99101 'sinh' : 'Computes the hyperbolic sine of the given value.' ,
100102 'tan' : 'Computes the tangent of the given value.' ,
101103 'tanh' : 'Computes the hyperbolic tangent of the given value.' ,
102- 'toDeg' : 'Converts an angle measured in radians to an approximately equivalent angle ' + \
104+ 'toDeg' : 'Converts an angle measured in radians to an approximately equivalent angle ' +
103105 'measured in degrees.' ,
104- 'toRad' : 'Converts an angle measured in degrees to an approximately equivalent angle ' + \
106+ 'toRad' : 'Converts an angle measured in degrees to an approximately equivalent angle ' +
105107 'measured in radians.'
106108}
107109
0 commit comments