----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/25012/#review51602 -----------------------------------------------------------
exec/java-exec/src/main/codegen/templates/RegrTypeFunctions.java <https://reviews.apache.org/r/25012/#comment90046> In Oracle's specification, regr_avgx and regr_avgy should discard all pairs where either x or y is null. "Oracle applies the function to the set of (expr1, expr2) pairs after eliminating all pairs for which either expr1 or expr2 is null. ..." exec/java-exec/src/main/codegen/templates/RegrTypeFunctions.java <https://reviews.apache.org/r/25012/#comment90051> How do we handle overflow in the numeric operation? exec/java-exec/src/main/codegen/templates/RegrTypeFunctions.java <https://reviews.apache.org/r/25012/#comment90047> How do we handle the case where count = 0? exec/java-exec/src/main/codegen/templates/RegrTypeFunctions.java <https://reviews.apache.org/r/25012/#comment90048> Also, seems to me the code for "regr_avgx" and "regr_avgy" are essentially same. Can we use one single template to generate them, by adding a list ("x", "y") to the freemarker template? exec/java-exec/src/test/resources/regr_input.json <https://reviews.apache.org/r/25012/#comment90050> I'm not sure what other people will think about this input data, containing 300 rows. I feel it's not easy to manually compute the result, and verify whether the result is correct. For unit test, I think we had better keep the data as simple as possilbe, while cover as wide scenarios as possible. Also, the unit test does not cover the case of some paris contain null values, and the case all the pairs contain nulls. - Jinfeng Ni On Aug. 24, 2014, 2:05 a.m., Yash Sharma wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/25012/ > ----------------------------------------------------------- > > (Updated Aug. 24, 2014, 2:05 a.m.) > > > Review request for drill, Jinfeng Ni and Mehant Baid. > > > Repository: drill-git > > > Description > ------- > > Stats function regr_avgx, regr_avgy > > > Diffs > ----- > > exec/java-exec/src/main/codegen/config.fmpp ff6135d > exec/java-exec/src/main/codegen/data/RegrTypes.tdd PRE-CREATION > exec/java-exec/src/main/codegen/templates/RegrTypeFunctions.java > PRE-CREATION > > exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunction.java > 5e57dc7 > exec/java-exec/src/test/resources/functions/test_regression.json > PRE-CREATION > exec/java-exec/src/test/resources/regr_input.json PRE-CREATION > > Diff: https://reviews.apache.org/r/25012/diff/ > > > Testing > ------- > > Done. > $mvn test -Dtest=TestAggregateFunction#testRegr > > > Thanks, > > Yash Sharma > >
