-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-9298][SQL] Add pearson correlation aggregation function #8587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
cb34a95
0dd6320
1505cd2
d3e4414
d10afbe
cc1657b
e1fb438
02562f3
5fbcf91
2f7b864
3b731e2
4f8c381
7dcf689
2de76b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -577,6 +577,10 @@ abstract class AggregationQuerySuite extends QueryTest with SQLTestUtils with Te | |
| val df2 = Seq.tabulate(20)(x => (1.0 * x, x * x - 2 * x + 3.5)).toDF("a", "b") | ||
| val corr3 = df2.groupBy().agg(corr("a", "b")).collect()(0).getDouble(0) | ||
| assert(math.abs(corr3 - 0.95723391394758572) < 1e-12) | ||
|
|
||
| val df3 = Seq.tabulate(0)(i => (1.0 * i, 2.0 * i)).toDF("a", "b") | ||
| val corr4 = df3.groupBy().agg(corr("a", "b")).collect()(0).getDouble(0) | ||
| assert(corr4.isNaN) | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What will happen if the data type of input parameters are not double?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will add ImplicitCastInputTypes to case class Corr. So the other NumericType can be automatically casting to double. |
||
|
|
||
| test("test Last implemented based on AggregateExpression1") { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullandNaNvalues.