Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/5858#discussion_r29557457
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/DataFrameStatFunctions.scala ---
@@ -28,6 +28,32 @@ import org.apache.spark.sql.execution.stat._
final class DataFrameStatFunctions private[sql](df: DataFrame) {
/**
+ * Calculates the correlation of two columns of a DataFrame. Currently
only supports the Pearson
+ * Correlation Coefficient. For Spearman Correlation, consider using RDD
methods found in
+ * MLlib's Statistics.
+ *
+ * @param col1 the name of the column
+ * @param col2 the name of the column to calculate the correlation
against
+ * @return The Pearson Correlation Coefficient as a Double.
+ */
+ def corr(col1: String, col2: String, method: String): Double = {
--- End diff --
Ditto. Accept `Column` as input?
---
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]