tools4origins opened a new pull request #24895: [DOC] Fix python variance() 
documentation
URL: https://github.com/apache/spark/pull/24895
 
 
   ## What changes were proposed in this pull request?
   
   The Python documentation incorrectly says that `variance()` acts as 
`var_pop` whereas it acts like `var_samp` here: 
https://spark.apache.org/docs/latest/api/python/pyspark.sql.html#pyspark.sql.functions.variance
   
   It was not the case in Spark 1.6 doc but it is in Spark 2.0 doc:
   
https://spark.apache.org/docs/1.6.0/api/java/org/apache/spark/sql/functions.html
   
https://spark.apache.org/docs/2.0.0/api/java/org/apache/spark/sql/functions.html
 
   
   The Scala documentation is correct: 
https://spark.apache.org/docs/latest/api/java/org/apache/spark/sql/functions.html#variance-org.apache.spark.sql.Column-
   
   The alias is set on this line:
   
https://github.com/apache/spark/blob/v2.4.3/sql/core/src/main/scala/org/apache/spark/sql/functions.scala#L786
   
   ## How was this patch tested?
   Usig variance() in pyspark 2.4.3 returns:
   ```
   >>> spark.createDataFrame([(1, ), (2, ), (3, )], "a: 
int").select(variance("a")).show()
   +-----------+
   |var_samp(a)|
   +-----------+
   |        1.0|
   +-----------+
   ```
   

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