Move Covariance (Population) covar_pop to be a User Defined Aggregate Function#10418
Move Covariance (Population) covar_pop to be a User Defined Aggregate Function#10418alamb merged 2 commits intoapache:mainfrom
Conversation
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { |
There was a problem hiding this comment.
I was thinking whether we should move these tests into the new files rather than deleting them. 🤔
There was a problem hiding this comment.
you can move it to aggregate.slt like what in #10384 does
There was a problem hiding this comment.
you can create another PR for moving test
alamb
left a comment
There was a problem hiding this comment.
Thank you @yyy1000 and @jayzhan211 -- I agree once we port over the tests this PR should be good to go 🙏
Would you prefer moving test in a separate PR or in this PR? I'm good either way. :) |
If the test can be verified one by one less than 5min, than it is fine for me to see them in one PR. |
| let state2 = get_accum_scalar_values_as_arrays(accum2.as_mut())?; | ||
| accum1.merge_batch(&state2)?; | ||
| accum1.evaluate() |
There was a problem hiding this comment.
I added all unit tests to sqllogictest excluding covariance_f64_merge_1 and covariance_f64_merge_2
Don't know how to mock these merge operations. 🥲
| )); | ||
|
|
||
| let actual = merge(&batch1, &batch2, agg1, agg2)?; | ||
| assert!(actual == ScalarValue::from(0.6666666666666666)); |
There was a problem hiding this comment.
we just need to test with multi column
covariance(a, b), where a is [1, 2,3]. b is [4,5,6]
There was a problem hiding this comment.
Got it, thanks!
I checked these two test case has been covered in covariance_f64_1 and covariance_f64_6 so all the tests are ported.
|
Thanks @yyy1000 and @jayzhan211 |
… Function (apache#10418) * move covariance * add sqllogictest
Which issue does this PR close?
Closes #10389 .
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?